Added fchmod() and fchown()

This commit is contained in:
Ben Gras
2006-04-18 11:26:04 +00:00
parent b1e5779b1c
commit 461a4fafb1
14 changed files with 83 additions and 15 deletions

View File

@@ -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
View 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
View 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));
}

View File

@@ -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
View File

@@ -0,0 +1,7 @@
.sect .text
.extern __fchmod
.define _fchmod
.align 2
_fchmod:
jmp __fchmod

7
lib/syscall/fchown.s Executable file
View File

@@ -0,0 +1,7 @@
.sect .text
.extern __fchown
.define _fchown
.align 2
_fchown:
jmp __fchown