Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
fe6272cc
Commit
fe6272cc
authored
Dec 16, 2017
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: emulate Flock on AIX
Reviewed-on:
https://go-review.googlesource.com/79095
From-SVN: r255737
parent
dead5b99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletions
+23
-1
gcc/go/gofrontend/MERGE
+1
-1
libgo/go/syscall/libcall_aix.go
+22
-0
No files found.
gcc/go/gofrontend/MERGE
View file @
fe6272cc
c02de8ca63f52a2475ce8645edee3203a3c908ac
d1f90c9b77baca5c33a398ab844fb4440c6a5ee7
The first line of this file holds the git revision number of the last
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
merge done from the gofrontend repository.
libgo/go/syscall/libcall_aix.go
View file @
fe6272cc
...
@@ -111,6 +111,28 @@ func Reboot(how int) (err error) {
...
@@ -111,6 +111,28 @@ func Reboot(how int) (err error) {
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
//fchownat(dirfd _C_int, path *byte, owner Uid_t, group Gid_t, flags _C_int) _C_int
//fchownat(dirfd _C_int, path *byte, owner Uid_t, group Gid_t, flags _C_int) _C_int
// On AIX, there is no flock() system call, we emulate it.
func
Flock
(
fd
int
,
op
int
)
(
err
error
)
{
lk
:=
&
Flock_t
{}
if
(
op
&
LOCK_UN
)
!=
0
{
lk
.
Type
=
F_UNLCK
}
else
if
(
op
&
LOCK_EX
)
!=
0
{
lk
.
Type
=
F_WRLCK
}
else
if
(
op
&
LOCK_SH
)
!=
0
{
lk
.
Type
=
F_RDLCK
}
else
{
return
nil
}
if
(
op
&
LOCK_NB
)
!=
0
{
err
=
FcntlFlock
(
uintptr
(
fd
),
F_SETLK
,
lk
)
if
err
!=
nil
&&
(
err
==
EAGAIN
||
err
==
EACCES
)
{
return
EWOULDBLOCK
}
return
err
}
return
FcntlFlock
(
uintptr
(
fd
),
F_SETLKW
,
lk
)
}
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
//fstatfs64(fd _C_int, buf *Statfs_t) _C_int
//fstatfs64(fd _C_int, buf *Statfs_t) _C_int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment