2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
#include <lib.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2011-03-03 17:44:18 +01:00
|
|
|
#ifdef __weak_alias
|
2013-12-02 20:03:35 +01:00
|
|
|
__weak_alias(__posix_chown, chown)
|
2011-03-03 17:44:18 +01:00
|
|
|
#endif
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int chown(const char *name, uid_t owner, gid_t grp)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.VFS_CHOWN_LEN = strlen(name) + 1;
|
|
|
|
m.VFS_CHOWN_OWNER = owner;
|
|
|
|
m.VFS_CHOWN_GROUP = grp;
|
|
|
|
m.VFS_CHOWN_NAME = (char *) __UNCONST(name);
|
|
|
|
return(_syscall(VFS_PROC_NR, VFS_CHOWN, &m));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|