Added fchmod() and fchown()
This commit is contained in:
@@ -27,6 +27,8 @@ libc_FILES=" \
|
||||
_execv.c \
|
||||
_execve.c \
|
||||
_execvp.c \
|
||||
_fchmod.c \
|
||||
_fchown.c \
|
||||
_fcntl.c \
|
||||
_fork.c \
|
||||
_fpathconf.c \
|
||||
|
||||
14
lib/posix/_fchmod.c
Executable file
14
lib/posix/_fchmod.c
Executable file
@@ -0,0 +1,14 @@
|
||||
#include <lib.h>
|
||||
#define fchmod _fchmod
|
||||
#include <sys/stat.h>
|
||||
|
||||
PUBLIC int fchmod(fd, mode)
|
||||
int fd;
|
||||
_mnx_Mode_t mode;
|
||||
{
|
||||
message m;
|
||||
|
||||
m.m3_i1 = fd;
|
||||
m.m3_i2 = mode;
|
||||
return(_syscall(FS, FCHMOD, &m));
|
||||
}
|
||||
17
lib/posix/_fchown.c
Executable file
17
lib/posix/_fchown.c
Executable file
@@ -0,0 +1,17 @@
|
||||
#include <lib.h>
|
||||
#define fchown _fchown
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
PUBLIC int fchown(fd, owner, grp)
|
||||
int fd;
|
||||
_mnx_Uid_t owner;
|
||||
_mnx_Gid_t grp;
|
||||
{
|
||||
message m;
|
||||
|
||||
m.m1_i1 = fd;
|
||||
m.m1_i2 = owner;
|
||||
m.m1_i3 = grp;
|
||||
return(_syscall(FS, FCHOWN, &m));
|
||||
}
|
||||
@@ -29,6 +29,8 @@ libc_FILES=" \
|
||||
execv.s \
|
||||
execve.s \
|
||||
execvp.s \
|
||||
fchown.s \
|
||||
fchmod.s \
|
||||
fcntl.s \
|
||||
fork.s \
|
||||
fpathconf.s \
|
||||
|
||||
7
lib/syscall/fchmod.s
Executable file
7
lib/syscall/fchmod.s
Executable file
@@ -0,0 +1,7 @@
|
||||
.sect .text
|
||||
.extern __fchmod
|
||||
.define _fchmod
|
||||
.align 2
|
||||
|
||||
_fchmod:
|
||||
jmp __fchmod
|
||||
7
lib/syscall/fchown.s
Executable file
7
lib/syscall/fchown.s
Executable file
@@ -0,0 +1,7 @@
|
||||
.sect .text
|
||||
.extern __fchown
|
||||
.define _fchown
|
||||
.align 2
|
||||
|
||||
_fchown:
|
||||
jmp __fchown
|
||||
Reference in New Issue
Block a user