chown in libc
This commit is contained in:
parent
b1fe4fa4ce
commit
1ecdb29e51
@ -66,6 +66,7 @@ struct utimbuf {
|
||||
extern char * ttyname(int fd);
|
||||
extern int utime(const char *filename, const struct utimbuf *times);
|
||||
extern int rmdir(const char *pathname); /* TODO rm probably just works */
|
||||
extern int chown(const char * pathname, uid_t owner, gid_t group);
|
||||
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
|
@ -42,7 +42,6 @@ DEFN_SYSCALL5(mount, SYS_MOUNT, char *, char *, char *, unsigned long, void *);
|
||||
DEFN_SYSCALL2(lstat, SYS_LSTAT, char *, void *);
|
||||
DEFN_SYSCALL2(fswait, SYS_FSWAIT, int, int *);
|
||||
DEFN_SYSCALL3(fswait2, SYS_FSWAIT2, int, int *,int);
|
||||
DEFN_SYSCALL3(chown, SYS_CHOWN, char *, int, int);
|
||||
|
||||
extern void _init();
|
||||
extern void _fini();
|
||||
|
11
libc/unistd/chown.c
Normal file
11
libc/unistd/chown.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <syscall.h>
|
||||
#include <syscall_nums.h>
|
||||
|
||||
DEFN_SYSCALL3(chown, SYS_CHOWN, char *, int, int);
|
||||
|
||||
int chown(const char * pathname, uid_t owner, gid_t group) {
|
||||
__sets_errno(syscall_chown((char*)pathname,owner,group));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user