Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
glibc
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
478f33c
abilist
aout
argp
assert
bare
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
gmon
gnulib
grp
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
locale
localedata
login
mach
malloc
manual
math
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
alpha
generic
gnu
hppa
i386
ia64
ieee754
m68k
mach
mips
posix
powerpc
pthread
rs6000
s390
sh
sparc
unix
alpha
bsd
common
i386
inet
mips
mman
powerpc
sh
sparc
sysv
bits
i386
linux
alpha
bits
hppa
i386
ia64
m68k
mips
net
netash
netatalk
netax25
neteconet
netinet
netipx
netpacket
netrom
netrose
nfs
powerpc
s390
scsi
sh
sparc
sys
wordsize-64
x86_64
Dist
Implies
Makefile
Versions
_exit.c
a.out.h
accept.S
adjtime.c
aio_sigqueue.c
bind.S
check_pf.c
clock.c
clock_getcpuclockid.c
clock_getres.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
cmsg_nxthdr.c
configure
configure.in
connect.S
device-nrs.h
dl-brk.c
dl-execstack.c
dl-librecon.h
dl-origin.c
dl-osinfo.h
dl-sbrk.c
dl-sysdep.c
dl-sysdep.h
errqueue.h
execve.c
exit-thread.S
fatal-prepare.h
fchownat.c
fcntl.c
fd_to_filename.h
fexecve.c
fpathconf.c
fstatfs64.c
fstatvfs.c
fstatvfs64.c
ftime.c
ftruncate64.c
futimes.c
futimesat.c
fxstat.c
fxstat64.c
fxstatat.c
fxstatat64.c
gai_sigqueue.c
getclktck.c
getcwd.c
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
gethostid.c
getipv4sourcefilter.c
getloadavg.c
getpagesize.c
getpeername.S
getpriority.c
getpt.c
getsockname.S
getsockopt.S
getsourcefilter.c
getsysstats.c
grantpt.c
if_index.c
ifaddrs.c
ifreq.c
ifreq.h
init-first.c
internal_statvfs.c
internal_statvfs64.c
ipc_priv.h
kernel-features.h
kernel-posix-cpu-timers.h
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
ldd-rewrite.sed
lddlibc4.c
ldsodefs.h
libc_fatal.c
linux_fsinfo.h
listen.S
llseek.c
lseek64.c
lxstat.c
lxstat64.c
makedev.c
mmap64.c
mq_close.c
mq_getattr.c
mq_notify.c
mq_open.c
mq_receive.c
mq_send.c
mq_unlink.c
msgctl.c
msgget.c
msgrcv.c
msgsnd.c
netlinkaccess.h
nice.c
not-cancel.h
nscd_setup_thread.c
ntp_gettime.c
open64.c
openat.c
openat64.c
opendir.c
opensock.c
pathconf.c
pathconf.h
paths.h
poll.c
posix_fadvise.c
posix_fadvise64.c
pread.c
pread64.c
prof-freq.c
profil.c
ptrace.c
ptsname.c
pwrite.c
pwrite64.c
readahead.c
readdir64.c
readdir64_r.c
readonly-area.c
readv.c
reboot.c
recv.S
recvfrom.S
recvmsg.S
renameat.c
sa_len.c
sched_getaffinity.c
sched_setaffinity.c
segfault.c
semctl.c
semget.c
semop.c
semtimedop.c
send.S
sendmsg.S
sendto.S
setegid.c
seteuid.c
setgid.c
sethostid.c
setipv4sourcefilter.c
setregid.c
setresgid.c
setresuid.c
setreuid.c
setsockopt.S
setsourcefilter.c
setuid.c
shm_open.c
shm_unlink.c
shmat.c
shmctl.c
shmdt.c
shmget.c
shutdown.S
sigaction.c
siglist.h
signal.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h
sigstack.c
sigsuspend.c
sigtimedwait.c
sigwait.c
sigwaitinfo.c
sizes.h
sleep.c
socketcall.h
socketpair.S
speed.c
statfs64.c
statvfs.c
statvfs64.c
syscalls.list
sysconf.c
sysctl.c
syslog.c
system.c
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsetattr.c
tcsetpgrp.c
termio.h
testrtsig.h
truncate64.c
ttyname.c
ttyname_r.c
ualarm.c
ulimit.c
umount.S
umount2.S
unlinkat.c
unlockpt.c
updwtmp.c
usleep.c
ustat.c
utimes.c
utmp_file.c
vfork.c
wait.c
wait3.c
waitid.c
waitpid.c
writev.c
xmknod.c
xstat.c
xstat64.c
xstatconv.c
xstatconv.h
Dist
Makefile
Versions
direct.h
getdents.c
gethostname.c
setrlimit.c
settimeofday.c
sigaction.c
syscalls.list
sysv_termio.h
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
x86_64
Dist
Implies
Makefile
Subdirs
_exit.S
alarm.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
closedir.c
configure
configure.in
confstr.h
dirfd.c
dirstream.h
errnos-tmpl.c
errnos.awk
execve.S
fdopendir.c
fork.S
fxstat.c
getdents.c
getegid.S
geteuid.S
getlogin.c
getlogin_r.c
getpagesize.c
getppid.S
grantpt.c
ioctls-tmpl.c
ioctls.awk
make-syscalls.sh
make_errlist.c
mk-local_lim.c
mkdir.c
mkfifo.c
nice.c
opendir.c
readdir.c
readdir_r.c
rewinddir.c
rmdir.c
s-proto-bp.S
s-proto-cancel.S
s-proto.S
seekdir.c
setxid.h
siglist.c
snarf-ioctls
sockatmark.c
start.c
stime.c
syscall.S
syscalls.list
sysdep.h
system.c
telldir.c
time.c
utime.c
xmknod.c
xstat.c
wordsize-32
wordsize-64
x86_64
linkmap.h
sysvipc
termios
time
timezone
wcsmbs
wctype
.cvsignore
BUGS
CANCEL-FCT-WAIVE
CANCEL-FILE-WAIVE
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
FAQ
FAQ.in
INSTALL
INTERFACE
LICENSES
MakeTAGS
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
NOTES
PROJECTS
README
README.libm
README.template
Rules
Versions.def
WUR-REPORT
abi-tags
aclocal.m4
config-name.in
config.h.in
config.make.in
configure
configure.in
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
o-iterator.mk
shlib-versions
test-skeleton.c
tls.make.c
version.h
Breadcrumbs
glibc
/
sysdeps
/
unix
/
sysv
/
linux
/
unlinkat.c
Blame
Blame
Latest commit
Ulrich Drepper
* sysdeps/unix/sysv/linux/fchownat.c: Include string.h.
Nov 16, 2005
478f33c
·
Nov 16, 2005
History
History
75 lines (62 loc) · 2.14 KB
Breadcrumbs
glibc
/
sysdeps
/
unix
/
sysv
/
linux
/
unlinkat.c
Top
File metadata and controls
Code
Blame
75 lines (62 loc) · 2.14 KB
Raw
/* Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <fcntl.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <unistd.h> /* Remove the link named NAME. */ int unlinkat (fd, file, flag) int fd; const char *file; int flag; { if (flag & ~AT_REMOVEDIR) { __set_errno (EINVAL); return -1; } char *buf = NULL; if (fd != AT_FDCWD && file[0] != '/') { size_t filelen = strlen (file); static const char procfd[] = "/proc/self/fd/%d/%s"; /* Buffer for the path name we are going to use. It consists of - the string /proc/self/fd/ - the file descriptor number - the file name provided. The final NUL is included in the sizeof. A bit of overhead due to the format elements compensates for possible negative numbers. */ size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; buf = alloca (buflen); __snprintf (buf, buflen, procfd, fd, file); file = buf; } int result; INTERNAL_SYSCALL_DECL (err); if (flag & AT_REMOVEDIR) result = INTERNAL_SYSCALL (rmdir, err, 1, file); else result = INTERNAL_SYSCALL (unlink, err, 1, file); if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0)) { __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); result = -1; } return result; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
You can’t perform that action at this time.