예제 #1
0
/* Change the permissions of the file referenced by FD to MODE.  */
int
__fchmod (int fd, mode_t mode)
{
  error_t err;

  if (err = HURD_DPORT_USE (fd, __file_chmod (port, mode)))
    return __hurd_dfail (fd, err);

  return 0;
}
예제 #2
0
파일: lchmod.c 프로젝트: AubrCool/glibc
/* Change the protections of FILE to MODE.  */
int
lchmod (const char *file, mode_t mode)
{
  error_t err;
  file_t port = __file_name_lookup (file, O_NOLINK, 0);
  if (port == MACH_PORT_NULL)
    return -1;
  err = __file_chmod (port, mode);
  __mach_port_deallocate (__mach_task_self (), port);
  if (err)
    return __hurd_fail (err);
  return 0;
}
예제 #3
0
int
fchmodat (int fd, const char *file, mode_t mode, int flag)
{
  error_t err;
  file_t port = __file_name_lookup_at (fd, flag, file, 0, 0);
  if (port == MACH_PORT_NULL)
    return -1;
  err = __file_chmod (port, mode);
  __mach_port_deallocate (__mach_task_self (), port);
  if (err)
    return __hurd_fail (err);
  return 0;
}