~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/unistd/fchown.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <unistd.h>
 
2
#include <errno.h>
 
3
#include "syscall.h"
 
4
 
 
5
void __procfdname(char *, unsigned);
 
6
 
 
7
int fchown(int fd, uid_t uid, gid_t gid)
 
8
{
 
9
        int ret = __syscall(SYS_fchown, fd, uid, gid);
 
10
        if (ret != -EBADF || fd < 0) return __syscall_ret(ret);
 
11
 
 
12
        char buf[15+3*sizeof(int)];
 
13
        __procfdname(buf, fd);
 
14
        return syscall(SYS_chown, buf, uid, gid);
 
15
}