summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/Makefile15
-rw-r--r--sysdeps/mach/hurd/Versions13
-rw-r--r--sysdeps/mach/hurd/_exit.c4
-rw-r--r--sysdeps/mach/hurd/accept.c4
-rw-r--r--sysdeps/mach/hurd/accept4.c4
-rw-r--r--sysdeps/mach/hurd/access.c5
-rw-r--r--sysdeps/mach/hurd/adjtime.c4
-rw-r--r--sysdeps/mach/hurd/bind.c4
-rw-r--r--sysdeps/mach/hurd/bits/errno.h8
-rw-r--r--sysdeps/mach/hurd/bits/fcntl.h19
-rw-r--r--sysdeps/mach/hurd/bits/ioctls.h4
-rw-r--r--sysdeps/mach/hurd/bits/local_lim.h4
-rw-r--r--sysdeps/mach/hurd/bits/param.h4
-rw-r--r--sysdeps/mach/hurd/bits/posix_opt.h4
-rw-r--r--sysdeps/mach/hurd/bits/socket.h4
-rw-r--r--sysdeps/mach/hurd/bits/stat.h8
-rw-r--r--sysdeps/mach/hurd/bits/statfs.h4
-rw-r--r--sysdeps/mach/hurd/bits/statvfs.h4
-rw-r--r--sysdeps/mach/hurd/bits/sysmacros.h4
-rw-r--r--sysdeps/mach/hurd/bits/types/error_t.h4
-rw-r--r--sysdeps/mach/hurd/bits/typesizes.h8
-rw-r--r--sysdeps/mach/hurd/brk.c4
-rw-r--r--sysdeps/mach/hurd/chdir.c4
-rw-r--r--sysdeps/mach/hurd/check_fds.c4
-rw-r--r--sysdeps/mach/hurd/chflags.c4
-rw-r--r--sysdeps/mach/hurd/chmod.c4
-rw-r--r--sysdeps/mach/hurd/chown.c4
-rw-r--r--sysdeps/mach/hurd/chroot.c4
-rw-r--r--sysdeps/mach/hurd/clock.c4
-rw-r--r--sysdeps/mach/hurd/clock_settime.c (renamed from sysdeps/mach/hurd/settimeofday.c)41
-rw-r--r--sysdeps/mach/hurd/close.c4
-rw-r--r--sysdeps/mach/hurd/close_nocancel_nostatus.c30
-rw-r--r--sysdeps/mach/hurd/closedir.c4
-rw-r--r--sysdeps/mach/hurd/configure.ac2
-rw-r--r--sysdeps/mach/hurd/connect.c4
-rw-r--r--sysdeps/mach/hurd/cthreads.c4
-rw-r--r--sysdeps/mach/hurd/device-nrs.h4
-rw-r--r--sysdeps/mach/hurd/dirfd.c4
-rw-r--r--sysdeps/mach/hurd/dirstream.h4
-rw-r--r--sysdeps/mach/hurd/dl-execstack.c4
-rw-r--r--sysdeps/mach/hurd/dl-fcntl.h4
-rw-r--r--sysdeps/mach/hurd/dl-mman.h4
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c54
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.h4
-rw-r--r--sysdeps/mach/hurd/dl-unistd.h4
-rw-r--r--sysdeps/mach/hurd/dup2.c4
-rw-r--r--sysdeps/mach/hurd/dup3.c4
-rw-r--r--sysdeps/mach/hurd/eloop-threshold.h4
-rw-r--r--sysdeps/mach/hurd/enbl-secure.c4
-rw-r--r--sysdeps/mach/hurd/errlist.c4
-rw-r--r--sysdeps/mach/hurd/errno-loc.c4
-rw-r--r--sysdeps/mach/hurd/errnos.awk7
-rw-r--r--sysdeps/mach/hurd/euidaccess.c4
-rw-r--r--sysdeps/mach/hurd/execve.c4
-rw-r--r--sysdeps/mach/hurd/f_setlk.c82
-rw-r--r--sysdeps/mach/hurd/f_setlk.h23
-rw-r--r--sysdeps/mach/hurd/faccessat.c8
-rw-r--r--sysdeps/mach/hurd/fchdir.c4
-rw-r--r--sysdeps/mach/hurd/fchflags.c4
-rw-r--r--sysdeps/mach/hurd/fchmod.c4
-rw-r--r--sysdeps/mach/hurd/fchmodat.c4
-rw-r--r--sysdeps/mach/hurd/fchown.c4
-rw-r--r--sysdeps/mach/hurd/fchownat.c4
-rw-r--r--sysdeps/mach/hurd/fcntl.c133
-rw-r--r--sysdeps/mach/hurd/fcntl64.c1
-rw-r--r--sysdeps/mach/hurd/fdatasync.c4
-rw-r--r--sysdeps/mach/hurd/fdopendir.c4
-rw-r--r--sysdeps/mach/hurd/fexecve.c4
-rw-r--r--sysdeps/mach/hurd/fgetxattr.c4
-rw-r--r--sysdeps/mach/hurd/flistxattr.c4
-rw-r--r--sysdeps/mach/hurd/flock.c4
-rw-r--r--sysdeps/mach/hurd/fork.c76
-rw-r--r--sysdeps/mach/hurd/fpathconf.c4
-rw-r--r--sysdeps/mach/hurd/fremovexattr.c4
-rw-r--r--sysdeps/mach/hurd/fsetxattr.c4
-rw-r--r--sysdeps/mach/hurd/fstatfs.c4
-rw-r--r--sysdeps/mach/hurd/fstatfs64.c4
-rw-r--r--sysdeps/mach/hurd/fstatvfs.c4
-rw-r--r--sysdeps/mach/hurd/fstatvfs64.c4
-rw-r--r--sysdeps/mach/hurd/fsync.c4
-rw-r--r--sysdeps/mach/hurd/ftruncate.c4
-rw-r--r--sysdeps/mach/hurd/ftruncate64.c4
-rw-r--r--sysdeps/mach/hurd/futimens.c4
-rw-r--r--sysdeps/mach/hurd/futimes.c4
-rw-r--r--sysdeps/mach/hurd/futimesat.c4
-rw-r--r--sysdeps/mach/hurd/fxstat.c4
-rw-r--r--sysdeps/mach/hurd/fxstat64.c4
-rw-r--r--sysdeps/mach/hurd/fxstatat.c4
-rw-r--r--sysdeps/mach/hurd/fxstatat64.c4
-rw-r--r--sysdeps/mach/hurd/gai_misc.h4
-rw-r--r--sysdeps/mach/hurd/getclktck.c4
-rw-r--r--sysdeps/mach/hurd/getcwd.c27
-rw-r--r--sysdeps/mach/hurd/getdomain.c4
-rw-r--r--sysdeps/mach/hurd/getdtsz.c4
-rw-r--r--sysdeps/mach/hurd/getegid.c4
-rw-r--r--sysdeps/mach/hurd/getentropy.c64
-rw-r--r--sysdeps/mach/hurd/geteuid.c4
-rw-r--r--sysdeps/mach/hurd/getgid.c4
-rw-r--r--sysdeps/mach/hurd/getgroups.c4
-rw-r--r--sysdeps/mach/hurd/gethostid.c4
-rw-r--r--sysdeps/mach/hurd/gethostname.c4
-rw-r--r--sysdeps/mach/hurd/getitimer.c15
-rw-r--r--sysdeps/mach/hurd/getlogin.c4
-rw-r--r--sysdeps/mach/hurd/getlogin_r.c4
-rw-r--r--sysdeps/mach/hurd/getpeername.c4
-rw-r--r--sysdeps/mach/hurd/getpgid.c4
-rw-r--r--sysdeps/mach/hurd/getpid.c4
-rw-r--r--sysdeps/mach/hurd/getppid.c4
-rw-r--r--sysdeps/mach/hurd/getpriority.c4
-rw-r--r--sysdeps/mach/hurd/getrandom.c46
-rw-r--r--sysdeps/mach/hurd/getresgid.c4
-rw-r--r--sysdeps/mach/hurd/getresuid.c4
-rw-r--r--sysdeps/mach/hurd/getrlimit.c4
-rw-r--r--sysdeps/mach/hurd/getrusage.c4
-rw-r--r--sysdeps/mach/hurd/getsid.c4
-rw-r--r--sysdeps/mach/hurd/getsockname.c4
-rw-r--r--sysdeps/mach/hurd/getsockopt.c4
-rw-r--r--sysdeps/mach/hurd/getuid.c4
-rw-r--r--sysdeps/mach/hurd/getxattr.c4
-rw-r--r--sysdeps/mach/hurd/group_member.c4
-rw-r--r--sysdeps/mach/hurd/hp-timing.h4
-rw-r--r--sysdeps/mach/hurd/htl/bits/pthread-np.h4
-rw-r--r--sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h4
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstacksize.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-docancel.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c7
-rw-r--r--sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-consistent.c14
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-destroy.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-init.c16
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-lock.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-timedlock.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c8
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-trylock.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-unlock.c12
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex.h14
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c8
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-init.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c11
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c5
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutexattr-settype.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate-destroy.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate-init.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-sigstate.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-sysdep.c4
-rw-r--r--sysdeps/mach/hurd/htl/pt-sysdep.h4
-rw-r--r--sysdeps/mach/hurd/i386/Makefile4
-rw-r--r--sysdeps/mach/hurd/i386/____longjmp_chk.S4
-rw-r--r--sysdeps/mach/hurd/i386/bits/sigcontext.h4
-rw-r--r--sysdeps/mach/hurd/i386/exc2signal.c4
-rw-r--r--sysdeps/mach/hurd/i386/htl/pt-machdep.c4
-rw-r--r--sysdeps/mach/hurd/i386/htl/pt-setup.c4
-rw-r--r--sysdeps/mach/hurd/i386/init-first.c19
-rw-r--r--sysdeps/mach/hurd/i386/intr-msg.h27
-rw-r--r--sysdeps/mach/hurd/i386/ioperm.c4
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist11
-rw-r--r--sysdeps/mach/hurd/i386/libm.abilist21
-rw-r--r--sysdeps/mach/hurd/i386/librt.abilist5
-rw-r--r--sysdeps/mach/hurd/i386/localplt.data5
-rw-r--r--sysdeps/mach/hurd/i386/longjmp-ts.c4
-rw-r--r--sysdeps/mach/hurd/i386/sigcontextinfo.h15
-rw-r--r--sysdeps/mach/hurd/i386/sigreturn.c72
-rw-r--r--sysdeps/mach/hurd/i386/static-start.S4
-rw-r--r--sysdeps/mach/hurd/i386/sys/io.h4
-rw-r--r--sysdeps/mach/hurd/i386/tls.h4
-rw-r--r--sysdeps/mach/hurd/i386/trampoline.c31
-rw-r--r--sysdeps/mach/hurd/if_index.c4
-rw-r--r--sysdeps/mach/hurd/ifreq.c4
-rw-r--r--sysdeps/mach/hurd/ifreq.h4
-rw-r--r--sysdeps/mach/hurd/ioctl.c44
-rw-r--r--sysdeps/mach/hurd/isatty.c4
-rw-r--r--sysdeps/mach/hurd/jmp-unwind.c8
-rw-r--r--sysdeps/mach/hurd/kernel-features.h4
-rw-r--r--sysdeps/mach/hurd/kill.c12
-rw-r--r--sysdeps/mach/hurd/lchmod.c4
-rw-r--r--sysdeps/mach/hurd/lchown.c4
-rw-r--r--sysdeps/mach/hurd/lgetxattr.c4
-rw-r--r--sysdeps/mach/hurd/libc-start.h4
-rw-r--r--sysdeps/mach/hurd/link.c4
-rw-r--r--sysdeps/mach/hurd/linkat.c4
-rw-r--r--sysdeps/mach/hurd/listen.c4
-rw-r--r--sysdeps/mach/hurd/listxattr.c4
-rw-r--r--sysdeps/mach/hurd/llistxattr.c4
-rw-r--r--sysdeps/mach/hurd/lremovexattr.c4
-rw-r--r--sysdeps/mach/hurd/lseek.c4
-rw-r--r--sysdeps/mach/hurd/lseek64.c4
-rw-r--r--sysdeps/mach/hurd/lsetxattr.c4
-rw-r--r--sysdeps/mach/hurd/lutimes.c4
-rw-r--r--sysdeps/mach/hurd/lxstat.c4
-rw-r--r--sysdeps/mach/hurd/lxstat64.c4
-rw-r--r--sysdeps/mach/hurd/malloc-machine.h4
-rw-r--r--sysdeps/mach/hurd/mig-reply.c10
-rw-r--r--sysdeps/mach/hurd/mkdir.c4
-rw-r--r--sysdeps/mach/hurd/mkdirat.c4
-rw-r--r--sysdeps/mach/hurd/mlock.c4
-rw-r--r--sysdeps/mach/hurd/mlockall.c4
-rw-r--r--sysdeps/mach/hurd/mmap.c31
-rw-r--r--sysdeps/mach/hurd/mmap64.c4
-rw-r--r--sysdeps/mach/hurd/msync.c93
-rw-r--r--sysdeps/mach/hurd/munlock.c4
-rw-r--r--sysdeps/mach/hurd/munlockall.c4
-rw-r--r--sysdeps/mach/hurd/net/ethernet.h4
-rw-r--r--sysdeps/mach/hurd/net/if_arp.h4
-rw-r--r--sysdeps/mach/hurd/net/if_ether.h4
-rw-r--r--sysdeps/mach/hurd/net/route.h4
-rw-r--r--sysdeps/mach/hurd/not-cancel.h62
-rw-r--r--sysdeps/mach/hurd/not-errno.h4
-rw-r--r--sysdeps/mach/hurd/open.c4
-rw-r--r--sysdeps/mach/hurd/openat.c4
-rw-r--r--sysdeps/mach/hurd/opendir.c4
-rw-r--r--sysdeps/mach/hurd/pathconf.c4
-rw-r--r--sysdeps/mach/hurd/pipe.c4
-rw-r--r--sysdeps/mach/hurd/pipe2.c4
-rw-r--r--sysdeps/mach/hurd/poll.c4
-rw-r--r--sysdeps/mach/hurd/ppoll.c4
-rw-r--r--sysdeps/mach/hurd/pread.c4
-rw-r--r--sysdeps/mach/hurd/pread64.c4
-rw-r--r--sysdeps/mach/hurd/profil.c4
-rw-r--r--sysdeps/mach/hurd/pselect.c4
-rw-r--r--sysdeps/mach/hurd/ptrace.c12
-rw-r--r--sysdeps/mach/hurd/ptsname.c4
-rw-r--r--sysdeps/mach/hurd/pwrite.c4
-rw-r--r--sysdeps/mach/hurd/pwrite64.c4
-rw-r--r--sysdeps/mach/hurd/read.c4
-rw-r--r--sysdeps/mach/hurd/readdir.c4
-rw-r--r--sysdeps/mach/hurd/readdir64.c4
-rw-r--r--sysdeps/mach/hurd/readdir64_r.c4
-rw-r--r--sysdeps/mach/hurd/readdir_r.c4
-rw-r--r--sysdeps/mach/hurd/readlink.c4
-rw-r--r--sysdeps/mach/hurd/readlinkat.c4
-rw-r--r--sysdeps/mach/hurd/reboot.c4
-rw-r--r--sysdeps/mach/hurd/recv.c4
-rw-r--r--sysdeps/mach/hurd/recvfrom.c4
-rw-r--r--sysdeps/mach/hurd/recvmsg.c4
-rw-r--r--sysdeps/mach/hurd/removexattr.c4
-rw-r--r--sysdeps/mach/hurd/rename.c4
-rw-r--r--sysdeps/mach/hurd/renameat.c25
-rw-r--r--sysdeps/mach/hurd/renameat2.c58
-rw-r--r--sysdeps/mach/hurd/res_enable_icmp.c27
-rw-r--r--sysdeps/mach/hurd/revoke.c4
-rw-r--r--sysdeps/mach/hurd/rewinddir.c4
-rw-r--r--sysdeps/mach/hurd/rmdir.c4
-rw-r--r--sysdeps/mach/hurd/sbrk.c4
-rw-r--r--sysdeps/mach/hurd/seekdir.c4
-rw-r--r--sysdeps/mach/hurd/select.c4
-rw-r--r--sysdeps/mach/hurd/send.c4
-rw-r--r--sysdeps/mach/hurd/sendfile.c4
-rw-r--r--sysdeps/mach/hurd/sendfile64.c4
-rw-r--r--sysdeps/mach/hurd/sendmsg.c4
-rw-r--r--sysdeps/mach/hurd/sendto.c4
-rw-r--r--sysdeps/mach/hurd/setdomain.c4
-rw-r--r--sysdeps/mach/hurd/setegid.c4
-rw-r--r--sysdeps/mach/hurd/seteuid.c4
-rw-r--r--sysdeps/mach/hurd/setgid.c4
-rw-r--r--sysdeps/mach/hurd/setgroups.c4
-rw-r--r--sysdeps/mach/hurd/sethostid.c4
-rw-r--r--sysdeps/mach/hurd/sethostname.c4
-rw-r--r--sysdeps/mach/hurd/setitimer.c49
-rw-r--r--sysdeps/mach/hurd/setlogin.c4
-rw-r--r--sysdeps/mach/hurd/setpgid.c4
-rw-r--r--sysdeps/mach/hurd/setpriority.c4
-rw-r--r--sysdeps/mach/hurd/setregid.c4
-rw-r--r--sysdeps/mach/hurd/setresgid.c4
-rw-r--r--sysdeps/mach/hurd/setresuid.c4
-rw-r--r--sysdeps/mach/hurd/setreuid.c4
-rw-r--r--sysdeps/mach/hurd/setrlimit.c4
-rw-r--r--sysdeps/mach/hurd/setsid.c4
-rw-r--r--sysdeps/mach/hurd/setsockopt.c4
-rw-r--r--sysdeps/mach/hurd/setuid.c4
-rw-r--r--sysdeps/mach/hurd/setxattr.c4
-rw-r--r--sysdeps/mach/hurd/shutdown.c4
-rw-r--r--sysdeps/mach/hurd/sigaction.c16
-rw-r--r--sysdeps/mach/hurd/sigaltstack.c9
-rw-r--r--sysdeps/mach/hurd/siglist.h4
-rw-r--r--sysdeps/mach/hurd/sigpending.c4
-rw-r--r--sysdeps/mach/hurd/sigprocmask.c4
-rw-r--r--sysdeps/mach/hurd/sigstack.c4
-rw-r--r--sysdeps/mach/hurd/sigsuspend.c4
-rw-r--r--sysdeps/mach/hurd/sigwait.c4
-rw-r--r--sysdeps/mach/hurd/socket.c4
-rw-r--r--sysdeps/mach/hurd/socketpair.c4
-rw-r--r--sysdeps/mach/hurd/spawni.c153
-rw-r--r--sysdeps/mach/hurd/statfs.c4
-rw-r--r--sysdeps/mach/hurd/statfs64.c4
-rw-r--r--sysdeps/mach/hurd/statfsconv.c4
-rw-r--r--sysdeps/mach/hurd/statvfs.c4
-rw-r--r--sysdeps/mach/hurd/statvfs64.c4
-rw-r--r--sysdeps/mach/hurd/symlink.c4
-rw-r--r--sysdeps/mach/hurd/symlinkat.c4
-rw-r--r--sysdeps/mach/hurd/sync.c4
-rw-r--r--sysdeps/mach/hurd/syncfs.c4
-rw-r--r--sysdeps/mach/hurd/sysconf.c4
-rw-r--r--sysdeps/mach/hurd/sysdep-cancel.h1
-rw-r--r--sysdeps/mach/hurd/telldir.c4
-rw-r--r--sysdeps/mach/hurd/times.c11
-rw-r--r--sysdeps/mach/hurd/tls.h4
-rw-r--r--sysdeps/mach/hurd/tmpfile.c4
-rw-r--r--sysdeps/mach/hurd/truncate.c4
-rw-r--r--sysdeps/mach/hurd/truncate64.c4
-rw-r--r--sysdeps/mach/hurd/ttyname.c4
-rw-r--r--sysdeps/mach/hurd/ttyname_r.c4
-rw-r--r--sysdeps/mach/hurd/umask.c4
-rw-r--r--sysdeps/mach/hurd/uname.c4
-rw-r--r--sysdeps/mach/hurd/unlink.c4
-rw-r--r--sysdeps/mach/hurd/unlinkat.c4
-rw-r--r--sysdeps/mach/hurd/utime-helper.c4
-rw-r--r--sysdeps/mach/hurd/utimensat.c4
-rw-r--r--sysdeps/mach/hurd/utimes.c4
-rw-r--r--sysdeps/mach/hurd/wait4.c4
-rw-r--r--sysdeps/mach/hurd/write.c4
-rw-r--r--sysdeps/mach/hurd/x86/dl-sysdep.c4
-rw-r--r--sysdeps/mach/hurd/xmknod.c4
-rw-r--r--sysdeps/mach/hurd/xmknodat.c4
-rw-r--r--sysdeps/mach/hurd/xstat.c4
-rw-r--r--sysdeps/mach/hurd/xstat64.c4
-rw-r--r--sysdeps/mach/hurd/xstatconv.c4
326 files changed, 1714 insertions, 969 deletions
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 3a853a6cd9..6b48d8f843 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2018 Free Software Foundation, Inc.
+# Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
+# <https://www.gnu.org/licenses/>.
ifdef in-Makerules
@@ -91,10 +91,11 @@ $(common-objpfx)errnos.d: $(mach-errnos-deps)
$(hurd)/bits/errno.h: $(common-objpfx)stamp-errnos ;
$(common-objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
$(mach-errnos-deps) $(common-objpfx)errnos.d
- $(AWK) -f $^ > $(hurd)/bits/errno.h-tmp
+ mkdir -p $(hurd-objpfx)bits
+ $(AWK) -f $^ > $(hurd-objpfx)bits/errno.h-tmp
# Make it unwritable so noone will edit it by mistake.
- -chmod a-w $(hurd)/bits/errno.h-tmp
- $(move-if-change) $(hurd)/bits/errno.h-tmp $(hurd)/bits/errno.h
+ -chmod a-w $(hurd-objpfx)bits/errno.h-tmp
+ $(move-if-change) $(hurd-objpfx)bits/errno.h-tmp $(hurd)/bits/errno.h
touch $@
common-generated += errnos.d stamp-errnos
@@ -194,6 +195,10 @@ ifeq (hurd, $(subdir))
sysdep_routines += cthreads
endif
+ifeq (io, $(subdir))
+sysdep_routines += f_setlk close_nocancel_nostatus
+endif
+
ifeq ($(subdir),sunrpc)
sysdep_headers += nfs/nfs.h
endif
diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions
index f69d5fef67..6ddd2977f6 100644
--- a/sysdeps/mach/hurd/Versions
+++ b/sysdeps/mach/hurd/Versions
@@ -1,7 +1,7 @@
libc {
GLIBC_2.0 {
# functions with a weak definition in the dynamic linker
- __access; __getcwd; __mmap;
+ __mmap;
}
GLIBC_2.2.6 {
# functions with a weak definition in the dynamic linker
@@ -9,10 +9,11 @@ libc {
}
GLIBC_PRIVATE {
# Functions shared with the dynamic linker
- __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
- __libc_lock_self0;
+ __access; __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
+ __libc_lock_self0; __sigprocmask; __getcwd;
_dl_init_first;
+ __close_nocancel_nostatus;
}
}
@@ -22,7 +23,7 @@ ld {
__hurd_threadvar_stack_mask; __hurd_threadvar_stack_offset;
# functions that must be shared with libc
- __access; __close; __getcwd; __getpid;
+ __close; __getpid;
__mmap; __open; __read; __sbrk; __strtoul_internal;
__write; __writev; __xstat64; __fxstat64;
_exit; _hurd_intr_rpc_mach_msg;
@@ -40,7 +41,7 @@ ld {
_dl_init_first;
# functions that must be shared with libc
- __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
- __libc_lock_self0;
+ __access; __access_noerrno; __libc_read; __libc_write; __libc_lseek64;
+ __libc_lock_self0; __sigprocmask; __getcwd;
}
}
diff --git a/sysdeps/mach/hurd/_exit.c b/sysdeps/mach/hurd/_exit.c
index 3cbda3ffa9..c46b707515 100644
--- a/sysdeps/mach/hurd/_exit.c
+++ b/sysdeps/mach/hurd/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/accept.c b/sysdeps/mach/hurd/accept.c
index a6a3a9a0a0..edc677eb0f 100644
--- a/sysdeps/mach/hurd/accept.c
+++ b/sysdeps/mach/hurd/accept.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/accept4.c b/sysdeps/mach/hurd/accept4.c
index 92bf92ddc3..d1f067302a 100644
--- a/sysdeps/mach/hurd/accept4.c
+++ b/sysdeps/mach/hurd/accept4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c
index 31fd5bea56..5072742352 100644
--- a/sysdeps/mach/hurd/access.c
+++ b/sysdeps/mach/hurd/access.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
@@ -35,4 +35,5 @@ __access (const char *file, int type)
{
return __faccessat (AT_FDCWD, file, type, 0);
}
+libc_hidden_def (__access)
weak_alias (__access, access)
diff --git a/sysdeps/mach/hurd/adjtime.c b/sysdeps/mach/hurd/adjtime.c
index 66ee42a6ff..57c0c21a10 100644
--- a/sysdeps/mach/hurd/adjtime.c
+++ b/sysdeps/mach/hurd/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/time.h>
diff --git a/sysdeps/mach/hurd/bind.c b/sysdeps/mach/hurd/bind.c
index fae826d534..af958e0ed9 100644
--- a/sysdeps/mach/hurd/bind.c
+++ b/sysdeps/mach/hurd/bind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/bits/errno.h b/sysdeps/mach/hurd/bits/errno.h
index 8096fb9c05..8f2fbfd80f 100644
--- a/sysdeps/mach/hurd/bits/errno.h
+++ b/sysdeps/mach/hurd/bits/errno.h
@@ -1,9 +1,17 @@
/* This file generated by errnos.awk from
errno.texi
+ stdc-predef.h
+ libc-symbols.h
mach/message.h
mach/kern_return.h
+ mach/i386/kern_return.h
+ mach/port.h
+ mach/boolean.h
+ mach/i386/boolean.h
+ mach/i386/vm_types.h
mach/mig_errors.h
device/device_types.h
+ mach/std_types.h
Do not edit this file; edit errnos.awk and regenerate it. */
#ifndef _BITS_ERRNO_H
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 2cfaa872a5..6faee6bbaf 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for GNU.
- Copyright (C) 1993-2018 Free Software Foundation, Inc.
+ Copyright (C) 1993-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
@@ -163,9 +163,18 @@
# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW 9 /* Set record locking info (blocking). */
+#ifdef __USE_FILE_OFFSET64
+# define F_GETLK F_GETLK64
+# define F_SETLK F_SETLK64
+# define F_SETLKW F_SETLKW64
+#else
+# define F_GETLK 7 /* Get record locking info. */
+# define F_SETLK 8 /* Set record locking info (non-blocking). */
+# define F_SETLKW 9 /* Set record locking info (blocking). */
+#endif
+#define F_GETLK64 10 /* Get record locking info. */
+#define F_SETLK64 11 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 12 /* Set record locking info (blocking). */
#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate, set FD_CLOEXEC on new one. */
diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index 91a15b5083..f4eec5c29d 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef __BITS_IOCTLS_H
#define __BITS_IOCTLS_H 1
diff --git a/sysdeps/mach/hurd/bits/local_lim.h b/sysdeps/mach/hurd/bits/local_lim.h
index 97f87ad5d2..1773e61b98 100644
--- a/sysdeps/mach/hurd/bits/local_lim.h
+++ b/sysdeps/mach/hurd/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Hurd version.
- Copyright (C) 1993-2018 Free Software Foundation, Inc.
+ Copyright (C) 1993-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* GNU has no arbitrary fixed limits on most of these things, so we
don't define the macros. Some things are unlimited. Some are in
diff --git a/sysdeps/mach/hurd/bits/param.h b/sysdeps/mach/hurd/bits/param.h
index 5d4faf793f..d8a4ad3752 100644
--- a/sysdeps/mach/hurd/bits/param.h
+++ b/sysdeps/mach/hurd/bits/param.h
@@ -1,5 +1,5 @@
/* Old-style Unix parameters and limits. Hurd version.
- Copyright (C) 1993-2018 Free Software Foundation, Inc.
+ Copyright (C) 1993-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _SYS_PARAM_H
# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index dfb0ba46ec..5471b64091 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
+++ b/sysdeps/mach/hurd/bits/posix_opt.h
@@ -1,5 +1,5 @@
/* Define POSIX options for GNU/Hurd.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _UNISTD_H
#error "Never include this file directly; use <unistd.h> instead."
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
index 18959139dc..68a102b68d 100644
--- a/sysdeps/mach/hurd/bits/socket.h
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#ifndef __BITS_SOCKET_H
#define __BITS_SOCKET_H 1
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index cb8680e000..f12382fe09 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#if !defined _SYS_STAT_H && !defined _FCNTL_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
@@ -218,8 +218,8 @@ struct stat64
#define S_IMMAP0 000100000000
/* ALL the unused bits. */
-#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0| \
- S_IUSEUNK|S_IUNKNOWN|07777))
+#define S_ISPARE (~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0 \
+ |S_IUSEUNK|S_IUNKNOWN|07777))
#endif
#ifdef __USE_MISC
diff --git a/sysdeps/mach/hurd/bits/statfs.h b/sysdeps/mach/hurd/bits/statfs.h
index 82e570b222..da7c4e431e 100644
--- a/sysdeps/mach/hurd/bits/statfs.h
+++ b/sysdeps/mach/hurd/bits/statfs.h
@@ -1,5 +1,5 @@
/* Definition of `struct statfs', information about a filesystem.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _SYS_STATFS_H
# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
diff --git a/sysdeps/mach/hurd/bits/statvfs.h b/sysdeps/mach/hurd/bits/statvfs.h
index 9880b2c9c7..969488c932 100644
--- a/sysdeps/mach/hurd/bits/statvfs.h
+++ b/sysdeps/mach/hurd/bits/statvfs.h
@@ -1,5 +1,5 @@
/* Definition of `struct statvfs', information about a filesystem.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _SYS_STATVFS_H
# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
diff --git a/sysdeps/mach/hurd/bits/sysmacros.h b/sysdeps/mach/hurd/bits/sysmacros.h
index b75a329d04..d7f5d9afa7 100644
--- a/sysdeps/mach/hurd/bits/sysmacros.h
+++ b/sysdeps/mach/hurd/bits/sysmacros.h
@@ -1,5 +1,5 @@
/* Definitions of macros to access `dev_t' values. Hurd version.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _BITS_SYSMACROS_H
#define _BITS_SYSMACROS_H 1
diff --git a/sysdeps/mach/hurd/bits/types/error_t.h b/sysdeps/mach/hurd/bits/types/error_t.h
index 286e5fdc6a..45cc1afe86 100644
--- a/sysdeps/mach/hurd/bits/types/error_t.h
+++ b/sysdeps/mach/hurd/bits/types/error_t.h
@@ -1,5 +1,5 @@
/* Define error_t.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <bits/errno.h>
diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
index d3026ba66e..3600137f50 100644
--- a/sysdeps/mach/hurd/bits/typesizes.h
+++ b/sysdeps/mach/hurd/bits/typesizes.h
@@ -1,5 +1,5 @@
/* bits/typesizes.h -- underlying types for *_t. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _BITS_TYPES_H
# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
@@ -64,5 +64,9 @@
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 256
+/* Tell the libc code that fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and
+ fsfilcnt64_t are not the same type for all ABI purposes. */
+# define __STATFS_MATCHES_STATFS64 0
+
#endif /* bits/typesizes.h */
diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
index f8272e5f22..8ff87913c3 100644
--- a/sysdeps/mach/hurd/brk.c
+++ b/sysdeps/mach/hurd/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/chdir.c b/sysdeps/mach/hurd/chdir.c
index b1cec6266c..dd0191c734 100644
--- a/sysdeps/mach/hurd/chdir.c
+++ b/sysdeps/mach/hurd/chdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/check_fds.c b/sysdeps/mach/hurd/check_fds.c
index c21432a80e..aa396830c3 100644
--- a/sysdeps/mach/hurd/check_fds.c
+++ b/sysdeps/mach/hurd/check_fds.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <fcntl.h>
#include <paths.h>
diff --git a/sysdeps/mach/hurd/chflags.c b/sysdeps/mach/hurd/chflags.c
index 4673043d74..9c589cf86c 100644
--- a/sysdeps/mach/hurd/chflags.c
+++ b/sysdeps/mach/hurd/chflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/chmod.c b/sysdeps/mach/hurd/chmod.c
index bed20efb7a..21c5ceb2f4 100644
--- a/sysdeps/mach/hurd/chmod.c
+++ b/sysdeps/mach/hurd/chmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/chown.c b/sysdeps/mach/hurd/chown.c
index 6a50f82646..125cc9b282 100644
--- a/sysdeps/mach/hurd/chown.c
+++ b/sysdeps/mach/hurd/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c
index bd08556824..2bfb68ce1c 100644
--- a/sysdeps/mach/hurd/chroot.c
+++ b/sysdeps/mach/hurd/chroot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <string.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/clock.c b/sysdeps/mach/hurd/clock.c
index 296ca89d21..a13f1d3a2d 100644
--- a/sysdeps/mach/hurd/clock.c
+++ b/sysdeps/mach/hurd/clock.c
@@ -1,5 +1,5 @@
/* Return the CPU time used by the program so far. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <time.h>
#include <sys/time.h>
diff --git a/sysdeps/mach/hurd/settimeofday.c b/sysdeps/mach/hurd/clock_settime.c
index a29c488ed7..a69fdca46a 100644
--- a/sysdeps/mach/hurd/settimeofday.c
+++ b/sysdeps/mach/hurd/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,40 +13,43 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
-#include <sys/time.h>
+#include <time.h>
#include <hurd.h>
#include <hurd/port.h>
+#include <shlib-compat.h>
-/* Set the current time of day and timezone information.
+/* Set the current time of day.
This call is restricted to the super-user. */
int
-__settimeofday (const struct timeval *tv, const struct timezone *tz)
+__clock_settime (clockid_t clock_id, const struct timespec *ts)
{
error_t err;
mach_port_t hostpriv;
+ time_value_t tv;
- if (tz != NULL)
- {
- errno = ENOSYS;
- return -1;
- }
+ if (clock_id != CLOCK_REALTIME
+ || ! valid_nanoseconds (ts->tv_nsec))
+ return __hurd_fail (EINVAL);
err = __get_privileged_ports (&hostpriv, NULL);
if (err)
return __hurd_fail (EPERM);
- /* `time_value_t' and `struct timeval' are in fact identical with the
- names changed. */
- err = __host_set_time (hostpriv, *(time_value_t *) tv);
+ TIMESPEC_TO_TIME_VALUE (&tv, ts);
+ err = __host_set_time (hostpriv, tv);
__mach_port_deallocate (__mach_task_self (), hostpriv);
- if (err)
- return __hurd_fail (err);
-
- return 0;
+ return __hurd_fail (err);
}
-
-weak_alias (__settimeofday, settimeofday)
+libc_hidden_def (__clock_settime)
+
+versioned_symbol (libc, __clock_settime, clock_settime, GLIBC_2_17);
+/* clock_settime moved to libc in version 2.17;
+ old binaries may expect the symbol version it had in librt. */
+#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
+strong_alias (__clock_settime, __clock_settime_2);
+compat_symbol (libc, __clock_settime_2, clock_settime, GLIBC_2_2);
+#endif
diff --git a/sysdeps/mach/hurd/close.c b/sysdeps/mach/hurd/close.c
index d064448b44..70dacf92f1 100644
--- a/sysdeps/mach/hurd/close.c
+++ b/sysdeps/mach/hurd/close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/close_nocancel_nostatus.c b/sysdeps/mach/hurd/close_nocancel_nostatus.c
new file mode 100644
index 0000000000..0c7c8acfba
--- /dev/null
+++ b/sysdeps/mach/hurd/close_nocancel_nostatus.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+#include <not-cancel.h>
+
+/* Close the file descriptor FD. */
+void
+__close_nocancel_nostatus (int fd)
+{
+ HURD_FD_USE (fd, _hurd_fd_close (descriptor));
+}
+libc_hidden_def (__close_nocancel_nostatus)
diff --git a/sysdeps/mach/hurd/closedir.c b/sysdeps/mach/hurd/closedir.c
index 783cd580ab..f858231c20 100644
--- a/sysdeps/mach/hurd/closedir.c
+++ b/sysdeps/mach/hurd/closedir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac
index 774ffc80a9..a294dd5ea2 100644
--- a/sysdeps/mach/hurd/configure.ac
+++ b/sysdeps/mach/hurd/configure.ac
@@ -28,5 +28,5 @@ if test -n "$sysheaders"; then
fi
dnl ifunc does not work yet for static binaries
-dnl http://www.gnu.org/software/hurd/open_issues/ifunc.html
+dnl https://www.gnu.org/software/hurd/open_issues/ifunc.html
libc_cv_ld_gnu_indirect_function=no
diff --git a/sysdeps/mach/hurd/connect.c b/sysdeps/mach/hurd/connect.c
index 537d686778..2014ec9828 100644
--- a/sysdeps/mach/hurd/connect.c
+++ b/sysdeps/mach/hurd/connect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/cthreads.c b/sysdeps/mach/hurd/cthreads.c
index 05c48e4e4c..e91b7ca2ae 100644
--- a/sysdeps/mach/hurd/cthreads.c
+++ b/sysdeps/mach/hurd/cthreads.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <libc-lock.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/device-nrs.h b/sysdeps/mach/hurd/device-nrs.h
index a006028e29..c961b80c44 100644
--- a/sysdeps/mach/hurd/device-nrs.h
+++ b/sysdeps/mach/hurd/device-nrs.h
@@ -1,5 +1,5 @@
/* Device numbers of devices used in the implementation. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _DEVICE_NRS_H
#define _DEVICE_NRS_H 1
diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c
index f70ee8d3e3..20fa2a3934 100644
--- a/sysdeps/mach/hurd/dirfd.c
+++ b/sysdeps/mach/hurd/dirfd.c
@@ -1,5 +1,5 @@
/* dirfd -- Return the file descriptor used by a DIR stream. Hurd version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <dirent.h>
#include <dirstream.h>
diff --git a/sysdeps/mach/hurd/dirstream.h b/sysdeps/mach/hurd/dirstream.h
index 45d2e8e571..4bb4729cec 100644
--- a/sysdeps/mach/hurd/dirstream.h
+++ b/sysdeps/mach/hurd/dirstream.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _DIRSTREAM_H
diff --git a/sysdeps/mach/hurd/dl-execstack.c b/sysdeps/mach/hurd/dl-execstack.c
index b658c9667e..8518dca9dd 100644
--- a/sysdeps/mach/hurd/dl-execstack.c
+++ b/sysdeps/mach/hurd/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Hurd version.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <ldsodefs.h>
#include <hurdstartup.h>
diff --git a/sysdeps/mach/hurd/dl-fcntl.h b/sysdeps/mach/hurd/dl-fcntl.h
index 3de29dced9..9292eef1cd 100644
--- a/sysdeps/mach/hurd/dl-fcntl.h
+++ b/sysdeps/mach/hurd/dl-fcntl.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/fcntl.h. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* __open can't be hidden in ld.so on Hurd since it will be preempted by the
one in libc.so after bootstrap. */
diff --git a/sysdeps/mach/hurd/dl-mman.h b/sysdeps/mach/hurd/dl-mman.h
index 3502c03187..776e19b45f 100644
--- a/sysdeps/mach/hurd/dl-mman.h
+++ b/sysdeps/mach/hurd/dl-mman.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/sys/mman.h. Hurd version.
- Copyright (C) 2015-2018 Free Software Foundation, Inc.
+ Copyright (C) 2015-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Can't hide __mmap on Hurd, since __mmap in ld.so will be preempted by
the one in libc.so after bootstrap. */
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index b72913d3ba..fcbbe6a43a 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Operating system support for run-time dynamic linker. Hurd version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* In the static library, this is all handled by dl-support.c
or by the vanilla definitions in the rest of the C library. */
@@ -62,10 +62,6 @@ int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
void *__libc_stack_end = NULL;
rtld_hidden_data_def(__libc_stack_end)
-#if HP_TIMING_AVAIL
-hp_timing_t _dl_cpuclock_offset;
-#endif
-
/* TODO: Initialize. */
void *_dl_random attribute_relro = NULL;
@@ -132,8 +128,8 @@ _dl_sysdep_start (void **start_argptr,
__tunables_init (_environ);
- if (_dl_hurd_data->flags & EXEC_STACK_ARGS &&
- _dl_hurd_data->user_entry == 0)
+ if (_dl_hurd_data->flags & EXEC_STACK_ARGS
+ && _dl_hurd_data->user_entry == 0)
_dl_hurd_data->user_entry = (vm_address_t) ENTRY_POINT;
unfmh(); /* XXX */
@@ -246,10 +242,6 @@ unfmh(); /* XXX */
/* Initialize frequently used global variable. */
GLRO(dl_pagesize) = __getpagesize ();
-#if HP_TIMING_AVAIL
- HP_TIMING_NOW (_dl_cpuclock_offset);
-#endif
-
fmh(); /* XXX */
/* See hurd/hurdstartup.c; this deals with getting information
@@ -272,19 +264,21 @@ _dl_sysdep_start_cleanup (void)
__mach_port_deallocate (__mach_task_self (), __mach_task_self_);
}
-/* Minimal open/close/mmap implementation sufficient for initial loading of
+/* Minimal open/close/mmap/etc. implementation sufficient for initial loading of
shared libraries. These are weak definitions so that when the
dynamic linker re-relocates itself to be user-visible (for -ldl),
it will get the user's definition (i.e. usually libc's).
- They also need to be set in the ld section of sysdeps/mach/hurd/Versions, to
- be overridable, and in libc.abilist and ld.abilist to be checked. */
+ They also need to be set in the libc and ld section of
+ sysdeps/mach/hurd/Versions, to be overridable, and in libc.abilist and
+ ld.abilist to be checked. */
/* This macro checks that the function does not get renamed to be hidden: we do
need these to be overridable by libc's. */
#define check_no_hidden(name) \
- static __typeof (name) __check_##name##_no_hidden \
- __attribute__ ((alias (#name)));
+ __typeof (name) __check_##name##_no_hidden \
+ __attribute__ ((alias (#name))) \
+ __attribute_copy__ (name);
/* Open FILE_NAME and return a Hurd I/O for it in *PORT, or return an
error. If STAT is non-zero, stat the file into that stat buffer. */
@@ -318,8 +312,8 @@ open_file (const char *file_name, int flags,
assert (!(flags & ~(O_READ | O_CLOEXEC)));
- startdir = _dl_hurd_data->portarray[file_name[0] == '/' ?
- INIT_PORT_CRDIR : INIT_PORT_CWDIR];
+ startdir = _dl_hurd_data->portarray[file_name[0] == '/'
+ ? INIT_PORT_CRDIR : INIT_PORT_CWDIR];
while (file_name[0] == '/')
file_name++;
@@ -364,9 +358,9 @@ __close (int fd)
return 0;
}
-check_no_hidden(__read);
+check_no_hidden(__pread64);
__ssize_t weak_function
-__read (int fd, void *buf, size_t nbytes)
+__pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
{
error_t err;
char *data;
@@ -374,7 +368,7 @@ __read (int fd, void *buf, size_t nbytes)
data = buf;
nread = nbytes;
- err = __io_read ((mach_port_t) fd, &data, &nread, -1, nbytes);
+ err = __io_read ((mach_port_t) fd, &data, &nread, offset, nbytes);
if (err)
return __hurd_fail (err);
@@ -386,6 +380,14 @@ __read (int fd, void *buf, size_t nbytes)
return nread;
}
+libc_hidden_weak (__pread64)
+
+check_no_hidden(__read);
+__ssize_t weak_function
+__read (int fd, void *buf, size_t nbytes)
+{
+ return __pread64 (fd, buf, nbytes, -1);
+}
libc_hidden_weak (__read)
check_no_hidden(__write);
@@ -673,6 +675,14 @@ strong_alias (abort, __GI___chk_fail)
strong_alias (abort, __GI___fortify_fail)
strong_alias (abort, __GI___assert_fail)
strong_alias (abort, __GI___assert_perror_fail)
+
+check_no_hidden(__sigprocmask);
+int weak_function
+__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
+{
+ /* We do not have signals yet at this stage. */
+ return 0;
+}
/* This function is called by interruptible RPC stubs. For initial
dynamic linking, just use the normal mach_msg. Since this defn is
diff --git a/sysdeps/mach/hurd/dl-sysdep.h b/sysdeps/mach/hurd/dl-sysdep.h
index 9a1f353a8d..c5bc4d44f3 100644
--- a/sysdeps/mach/hurd/dl-sysdep.h
+++ b/sysdeps/mach/hurd/dl-sysdep.h
@@ -1,5 +1,5 @@
/* System-specific settings for dynamic linker code. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* The private errno doesn't make sense on the Hurd. errno is always the
thread-local slot shared with libc, and it matters to share the cell
diff --git a/sysdeps/mach/hurd/dl-unistd.h b/sysdeps/mach/hurd/dl-unistd.h
index da7f0ed18d..372bbe8c22 100644
--- a/sysdeps/mach/hurd/dl-unistd.h
+++ b/sysdeps/mach/hurd/dl-unistd.h
@@ -1,6 +1,6 @@
/* Functions with hidden attribute internal to ld.so, which are declared
in include/unistd.h. Hurd version.
- Copyright (C) 2015-2018 Free Software Foundation, Inc.
+ Copyright (C) 2015-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Most stubs mustn't be hidden in ld.so on Hurd since they need to be preempted
by functions from libc.so after bootstrap. */
diff --git a/sysdeps/mach/hurd/dup2.c b/sysdeps/mach/hurd/dup2.c
index 3615461cb5..58650e609c 100644
--- a/sysdeps/mach/hurd/dup2.c
+++ b/sysdeps/mach/hurd/dup2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/dup3.c b/sysdeps/mach/hurd/dup3.c
index 09ea24a00b..275be4c146 100644
--- a/sysdeps/mach/hurd/dup3.c
+++ b/sysdeps/mach/hurd/dup3.c
@@ -1,5 +1,5 @@
/* Duplicate a file descriptor to a given number, with flags. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/eloop-threshold.h b/sysdeps/mach/hurd/eloop-threshold.h
index 2eaf4e2c5d..e09295b2fb 100644
--- a/sysdeps/mach/hurd/eloop-threshold.h
+++ b/sysdeps/mach/hurd/eloop-threshold.h
@@ -1,5 +1,5 @@
/* Threshold at which to diagnose ELOOP. Hurd version.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _ELOOP_THRESHOLD_H
#define _ELOOP_THRESHOLD_H 1
diff --git a/sysdeps/mach/hurd/enbl-secure.c b/sysdeps/mach/hurd/enbl-secure.c
index 772bdb6bf8..5a417bb3a8 100644
--- a/sysdeps/mach/hurd/enbl-secure.c
+++ b/sysdeps/mach/hurd/enbl-secure.c
@@ -1,5 +1,5 @@
/* Define and initialize the `__libc_enable_secure' flag. Hurd version.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* There is no need for this file in the Hurd; it is just a placeholder
to prevent inclusion of the sysdeps/generic version.
diff --git a/sysdeps/mach/hurd/errlist.c b/sysdeps/mach/hurd/errlist.c
index 77cbabf23c..1cfda3b39f 100644
--- a/sysdeps/mach/hurd/errlist.c
+++ b/sysdeps/mach/hurd/errlist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* sys_errlist cannot have Unix semantics on the Hurd, so it is easier just
to rename it. We also need to remap error codes to array indices by
diff --git a/sysdeps/mach/hurd/errno-loc.c b/sysdeps/mach/hurd/errno-loc.c
index 05e7673743..31a313248c 100644
--- a/sysdeps/mach/hurd/errno-loc.c
+++ b/sysdeps/mach/hurd/errno-loc.c
@@ -1,5 +1,5 @@
/* __errno_location -- helper function for locating per-thread errno value
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#if IS_IN (rtld)
/* rtld can not access TLS too early, thus rtld_errno.
diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk
index dc19350eb0..94a76a3f11 100644
--- a/sysdeps/mach/hurd/errnos.awk
+++ b/sysdeps/mach/hurd/errnos.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2018 Free Software Foundation, Inc.
+# Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
+# <https://www.gnu.org/licenses/>.
# errno.texinfo contains lines like:
# @errno{ENOSYS, 123, Function not implemented}
@@ -23,7 +23,8 @@ BEGIN {
for (i = 1; i < ARGC; i++)
{
arg = ARGV[i];
- sub(/.*(manual|include)\//, "", arg)
+ sub(/.*(manual|include)\//, "", arg);
+ if (arg ~ /.*errnos.d/) continue;
print " " arg;
}
print " Do not edit this file; edit errnos.awk and regenerate it. */";
diff --git a/sysdeps/mach/hurd/euidaccess.c b/sysdeps/mach/hurd/euidaccess.c
index 2c7ce1f2b6..a6c6309a2c 100644
--- a/sysdeps/mach/hurd/euidaccess.c
+++ b/sysdeps/mach/hurd/euidaccess.c
@@ -1,5 +1,5 @@
/* Test for access to FILE using effective UID and GID. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/execve.c b/sysdeps/mach/hurd/execve.c
index 1c5b681d89..a1942fb767 100644
--- a/sysdeps/mach/hurd/execve.c
+++ b/sysdeps/mach/hurd/execve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/f_setlk.c b/sysdeps/mach/hurd/f_setlk.c
new file mode 100644
index 0000000000..dc77e845aa
--- /dev/null
+++ b/sysdeps/mach/hurd/f_setlk.c
@@ -0,0 +1,82 @@
+/* f_setlk -- locking part of fcntl
+ Copyright (C) 2014-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+/* XXX
+ We need new RPCs to support POSIX.1 fcntl file locking!!
+ For the time being we support the whole-file case only,
+ with all kinds of WRONG WRONG WRONG semantics,
+ by using flock. This is definitely the Wrong Thing,
+ but it might be better than nothing (?). */
+int
+__f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wait)
+{
+ int cmd = 0;
+
+ switch (type)
+ {
+ case F_RDLCK: cmd = LOCK_SH; break;
+ case F_WRLCK: cmd = LOCK_EX; break;
+ case F_UNLCK: cmd = LOCK_UN; break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (cmd != LOCK_UN && wait == 0)
+ cmd |= LOCK_NB;
+
+ if (whence == SEEK_CUR)
+ {
+ /* In case the target position is 0, we can support it below. */
+ __off64_t cur = __lseek64 (fd, 0, SEEK_CUR);
+
+ if (cur >= 0)
+ {
+ start = cur + start;
+ whence = SEEK_SET;
+ }
+ }
+
+ switch (whence)
+ {
+ case SEEK_SET:
+ if (start == 0 && len == 0) /* Whole file request. */
+ break;
+ /* It seems to be common for applications to lock the first
+ byte of the file when they are really doing whole-file locking.
+ So, since it's so wrong already, might as well do that too. */
+ if (start == 0 && len == 1)
+ break;
+ /* FALLTHROUGH */
+ case SEEK_CUR:
+ case SEEK_END:
+ errno = ENOTSUP;
+ return -1;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ return __flock (fd, cmd);
+}
diff --git a/sysdeps/mach/hurd/f_setlk.h b/sysdeps/mach/hurd/f_setlk.h
new file mode 100644
index 0000000000..4fe47fe7ba
--- /dev/null
+++ b/sysdeps/mach/hurd/f_setlk.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2014-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _F_SETLK_H
+#define _F_SETLK_H 1
+
+extern int __f_setlk (int fd, int type, int whence, __off64_t start, __off64_t len, int wait);
+
+#endif /* f_setlk.h */
diff --git a/sysdeps/mach/hurd/faccessat.c b/sysdeps/mach/hurd/faccessat.c
index d9bceaada7..9f5f1dd4d8 100644
--- a/sysdeps/mach/hurd/faccessat.c
+++ b/sysdeps/mach/hurd/faccessat.c
@@ -1,5 +1,5 @@
/* Test for access to file, relative to open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
@@ -60,7 +60,9 @@ __faccessat_common (int fd, const char *file, int type, int at_flags,
usual effective permissions. */
int hurd_flags = 0;
- __hurd_at_flags (&at_flags, &hurd_flags);
+ err = __hurd_at_flags (&at_flags, &hurd_flags);
+ if (err)
+ return errfunc (err);
error_t reauthenticate_cwdir_at (file_t *result)
{
diff --git a/sysdeps/mach/hurd/fchdir.c b/sysdeps/mach/hurd/fchdir.c
index 94ceda8a03..d862dcbb1e 100644
--- a/sysdeps/mach/hurd/fchdir.c
+++ b/sysdeps/mach/hurd/fchdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/fchflags.c b/sysdeps/mach/hurd/fchflags.c
index 443c8d9406..15cc687224 100644
--- a/sysdeps/mach/hurd/fchflags.c
+++ b/sysdeps/mach/hurd/fchflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fchmod.c b/sysdeps/mach/hurd/fchmod.c
index 5dd5dd99d9..908a38c704 100644
--- a/sysdeps/mach/hurd/fchmod.c
+++ b/sysdeps/mach/hurd/fchmod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fchmodat.c b/sysdeps/mach/hurd/fchmodat.c
index 4b4dabad31..5fadca11cc 100644
--- a/sysdeps/mach/hurd/fchmodat.c
+++ b/sysdeps/mach/hurd/fchmodat.c
@@ -1,5 +1,5 @@
/* Change the protections of file relative to open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/fchown.c b/sysdeps/mach/hurd/fchown.c
index 2c4c666c6f..a8de5054e5 100644
--- a/sysdeps/mach/hurd/fchown.c
+++ b/sysdeps/mach/hurd/fchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fchownat.c b/sysdeps/mach/hurd/fchownat.c
index 906ec05ba3..031df00151 100644
--- a/sysdeps/mach/hurd/fchownat.c
+++ b/sysdeps/mach/hurd/fchownat.c
@@ -1,5 +1,5 @@
/* Change owner and group of a file relative to open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 598317d811..0e3f0adbd9 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
@@ -21,6 +21,7 @@
#include <hurd/fd.h>
#include <stdarg.h>
#include <sys/file.h> /* XXX for LOCK_* */
+#include "f_setlk.h"
/* Perform file control operations on FD. */
int
@@ -128,56 +129,111 @@ __libc_fcntl (int fd, int cmd, ...)
case F_SETLK:
case F_SETLKW:
{
- /* XXX
- We need new RPCs to support POSIX.1 fcntl file locking!!
- For the time being we support the whole-file case only,
- with all kinds of WRONG WRONG WRONG semantics,
- by using flock. This is definitely the Wrong Thing,
- but it might be better than nothing (?). */
struct flock *fl = va_arg (ap, struct flock *);
- va_end (ap);
+
switch (cmd)
{
case F_GETLK:
- errno = ENOSYS;
- return -1;
+ cmd = F_GETLK64;
+ break;
case F_SETLK:
- cmd = LOCK_NB;
+ cmd = F_SETLK64;
break;
- default:
- cmd = 0;
+ case F_SETLKW:
+ cmd = F_SETLKW64;
break;
- }
- switch (fl->l_type)
- {
- case F_RDLCK: cmd |= LOCK_SH; break;
- case F_WRLCK: cmd |= LOCK_EX; break;
- case F_UNLCK: cmd |= LOCK_UN; break;
default:
errno = EINVAL;
return -1;
}
- switch (fl->l_whence)
+
+ struct flock64 fl64 = {
+ .l_type = fl->l_type,
+ .l_whence = fl->l_whence,
+ .l_start = fl->l_start,
+ .l_len = fl->l_len,
+ .l_pid = fl->l_pid
+ };
+
+ err = HURD_FD_PORT_USE (d, __file_record_lock (port, cmd, &fl64,
+ MACH_PORT_NULL, MACH_MSG_TYPE_MAKE_SEND));
+
+ /* XXX: To remove once file_record_lock RPC is settled. */
+ if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
{
- case SEEK_SET:
- if (fl->l_start == 0 && fl->l_len == 0) /* Whole file request. */
- break;
- /* It seems to be common for applications to lock the first
- byte of the file when they are really doing whole-file locking.
- So, since it's so wrong already, might as well do that too. */
- if (fl->l_start == 0 && fl->l_len == 1)
- break;
- /* FALLTHROUGH */
- case SEEK_CUR:
- case SEEK_END:
- errno = ENOTSUP;
- return -1;
- default:
- errno = EINVAL;
- return -1;
+ int wait = 0;
+ va_end (ap);
+ switch (cmd)
+ {
+ case F_GETLK64:
+ errno = ENOSYS;
+ return -1;
+ case F_SETLKW64:
+ wait = 1;
+ /* FALLTHROUGH */
+ case F_SETLK64:
+ return __f_setlk (fd, fl->l_type, fl->l_whence,
+ fl->l_start, fl->l_len, wait);
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ else if (cmd == F_GETLK64)
+ {
+ fl->l_type = fl64.l_type;
+ fl->l_whence = fl64.l_whence;
+ fl->l_start = fl64.l_start;
+ fl->l_len = fl64.l_len;
+ fl->l_pid = fl64.l_pid;
+
+ if ((sizeof fl->l_start != sizeof fl64.l_start
+ && fl->l_start != fl64.l_start)
+ || (sizeof fl->l_len != sizeof fl64.l_len
+ && fl->l_len != fl64.l_len))
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ }
+
+ result = err ? __hurd_dfail (fd, err) : 0;
+ break;
+ }
+
+ case F_GETLK64:
+ case F_SETLK64:
+ case F_SETLKW64:
+ {
+ struct flock64 *fl = va_arg (ap, struct flock64 *);
+
+ err = HURD_FD_PORT_USE (d, __file_record_lock (port, cmd, fl,
+ MACH_PORT_NULL, MACH_MSG_TYPE_MAKE_SEND));
+
+ /* XXX: To remove once file_record_lock RPC is settled. */
+ if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
+ {
+ int wait = 0;
+ va_end (ap);
+ switch (cmd)
+ {
+ case F_GETLK64:
+ errno = ENOSYS;
+ return -1;
+ case F_SETLKW64:
+ wait = 1;
+ /* FALLTHROUGH */
+ case F_SETLK64:
+ return __f_setlk (fd, fl->l_type, fl->l_whence,
+ fl->l_start, fl->l_len, wait);
+ default:
+ errno = EINVAL;
+ return -1;
+ }
}
- return __flock (fd, cmd);
+ result = err ? __hurd_dfail (fd, err) : 0;
+ break;
}
case F_GETFL: /* Get per-open flags. */
@@ -215,3 +271,4 @@ strong_alias (__libc_fcntl, __libc_fcntl64)
libc_hidden_def (__libc_fcntl64)
weak_alias (__libc_fcntl64, __fcntl64)
libc_hidden_weak (__fcntl64)
+weak_alias (__fcntl64, fcntl64)
diff --git a/sysdeps/mach/hurd/fcntl64.c b/sysdeps/mach/hurd/fcntl64.c
new file mode 100644
index 0000000000..8b85360690
--- /dev/null
+++ b/sysdeps/mach/hurd/fcntl64.c
@@ -0,0 +1 @@
+/* fcntl64 is defined in fcntl.c as an alias. */
diff --git a/sysdeps/mach/hurd/fdatasync.c b/sysdeps/mach/hurd/fdatasync.c
index eda679f4c6..bdd29b9447 100644
--- a/sysdeps/mach/hurd/fdatasync.c
+++ b/sysdeps/mach/hurd/fdatasync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/fdopendir.c b/sysdeps/mach/hurd/fdopendir.c
index ec3a7486fd..2486e9c23d 100644
--- a/sysdeps/mach/hurd/fdopendir.c
+++ b/sysdeps/mach/hurd/fdopendir.c
@@ -1,5 +1,5 @@
/* Open a directory stream from a file descriptor. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <dirent.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/fexecve.c b/sysdeps/mach/hurd/fexecve.c
index c5679f197e..05800c9602 100644
--- a/sysdeps/mach/hurd/fexecve.c
+++ b/sysdeps/mach/hurd/fexecve.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/fgetxattr.c b/sysdeps/mach/hurd/fgetxattr.c
index fc0b1feb12..80c03ecf58 100644
--- a/sysdeps/mach/hurd/fgetxattr.c
+++ b/sysdeps/mach/hurd/fgetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/flistxattr.c b/sysdeps/mach/hurd/flistxattr.c
index 4564f50948..794f6eb14d 100644
--- a/sysdeps/mach/hurd/flistxattr.c
+++ b/sysdeps/mach/hurd/flistxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/flock.c b/sysdeps/mach/hurd/flock.c
index 6d6f748df3..977ca4e82a 100644
--- a/sysdeps/mach/hurd/flock.c
+++ b/sysdeps/mach/hurd/flock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/file.h>
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 2d1e64c8d1..d0bf7642b8 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
@@ -271,11 +271,11 @@ __fork (void)
port,
MACH_MSG_TYPE_MOVE_SEND))
LOSE;
- if (refs > 1 &&
- (err = __mach_port_mod_refs (newtask,
- portnames[i],
- MACH_PORT_RIGHT_SEND,
- refs - 1)))
+ if (refs > 1
+ && (err = __mach_port_mod_refs (newtask,
+ portnames[i],
+ MACH_PORT_RIGHT_SEND,
+ refs - 1)))
LOSE;
}
if (porttypes[i] & MACH_PORT_TYPE_SEND_ONCE)
@@ -297,8 +297,8 @@ __fork (void)
LOSE;
}
}
- else if (porttypes[i] &
- (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_DEAD_NAME))
+ else if (porttypes[i]
+ & (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_DEAD_NAME))
{
/* This is a send right or a dead name.
Give the child as many references for it as we have. */
@@ -367,8 +367,8 @@ __fork (void)
LOSE;
if (insert == MACH_PORT_NULL)
continue;
- if (insert == portnames[i] &&
- (porttypes[i] & MACH_PORT_TYPE_DEAD_NAME))
+ if (insert == portnames[i]
+ && (porttypes[i] & MACH_PORT_TYPE_DEAD_NAME))
/* This is a dead name; allocate another dead name
with the same name in the child. */
allocate_dead_name:
@@ -393,10 +393,10 @@ __fork (void)
assert (__mach_port_extract_right (newtask, portnames[i],
MACH_MSG_TYPE_COPY_SEND,
&childport,
- &poly) == 0 &&
- childport == insert &&
- __mach_port_deallocate (__mach_task_self (),
- childport) == 0);
+ &poly) == 0
+ && childport == insert
+ && __mach_port_deallocate (__mach_task_self (),
+ childport) == 0);
break;
}
@@ -411,11 +411,11 @@ __fork (void)
case KERN_SUCCESS:
/* Give the child as many user references as we have. */
- if (refs > 1 &&
- (err = __mach_port_mod_refs (newtask,
- portnames[i],
- MACH_PORT_RIGHT_SEND,
- refs - 1)))
+ if (refs > 1
+ && (err = __mach_port_mod_refs (newtask,
+ portnames[i],
+ MACH_PORT_RIGHT_SEND,
+ refs - 1)))
LOSE;
}
}
@@ -432,33 +432,35 @@ __fork (void)
resume_threads ();
/* Create the child main user thread and signal thread. */
- if ((err = __thread_create (newtask, &thread)) ||
- (err = __thread_create (newtask, &sigthread)))
+ if ((err = __thread_create (newtask, &thread))
+ || (err = __thread_create (newtask, &sigthread)))
LOSE;
/* Insert send rights for those threads. We previously allocated
dead name rights with the names we want to give the thread ports
in the child as placeholders. Now deallocate them so we can use
the names. */
- if ((err = __mach_port_deallocate (newtask, ss->thread)) ||
- (err = __mach_port_insert_right (newtask, ss->thread,
- thread, MACH_MSG_TYPE_COPY_SEND)))
+ if ((err = __mach_port_deallocate (newtask, ss->thread))
+ || (err = __mach_port_insert_right (newtask, ss->thread,
+ thread,
+ MACH_MSG_TYPE_COPY_SEND)))
LOSE;
- if (thread_refs > 1 &&
- (err = __mach_port_mod_refs (newtask, ss->thread,
- MACH_PORT_RIGHT_SEND,
- thread_refs - 1)))
+ if (thread_refs > 1
+ && (err = __mach_port_mod_refs (newtask, ss->thread,
+ MACH_PORT_RIGHT_SEND,
+ thread_refs - 1)))
LOSE;
if ((_hurd_msgport_thread != MACH_PORT_NULL) /* Let user have none. */
- && ((err = __mach_port_deallocate (newtask, _hurd_msgport_thread)) ||
- (err = __mach_port_insert_right (newtask, _hurd_msgport_thread,
- sigthread,
- MACH_MSG_TYPE_COPY_SEND))))
+ && ((err = __mach_port_deallocate (newtask, _hurd_msgport_thread))
+ || (err = __mach_port_insert_right (newtask,
+ _hurd_msgport_thread,
+ sigthread,
+ MACH_MSG_TYPE_COPY_SEND))))
LOSE;
- if (sigthread_refs > 1 &&
- (err = __mach_port_mod_refs (newtask, _hurd_msgport_thread,
- MACH_PORT_RIGHT_SEND,
- sigthread_refs - 1)))
+ if (sigthread_refs > 1
+ && (err = __mach_port_mod_refs (newtask, _hurd_msgport_thread,
+ MACH_PORT_RIGHT_SEND,
+ sigthread_refs - 1)))
LOSE;
/* This seems like a convenient juncture to copy the proc server's
diff --git a/sysdeps/mach/hurd/fpathconf.c b/sysdeps/mach/hurd/fpathconf.c
index 4332aa70ac..a2669aee88 100644
--- a/sysdeps/mach/hurd/fpathconf.c
+++ b/sysdeps/mach/hurd/fpathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fremovexattr.c b/sysdeps/mach/hurd/fremovexattr.c
index 662ae38f89..3ae38859e3 100644
--- a/sysdeps/mach/hurd/fremovexattr.c
+++ b/sysdeps/mach/hurd/fremovexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/fsetxattr.c b/sysdeps/mach/hurd/fsetxattr.c
index cd9653765c..9051fbc494 100644
--- a/sysdeps/mach/hurd/fsetxattr.c
+++ b/sysdeps/mach/hurd/fsetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/fstatfs.c b/sysdeps/mach/hurd/fstatfs.c
index e8b03d24e7..c06fef4a86 100644
--- a/sysdeps/mach/hurd/fstatfs.c
+++ b/sysdeps/mach/hurd/fstatfs.c
@@ -1,5 +1,5 @@
/* fstatfs -- Return information about the filesystem on which FD resides.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
diff --git a/sysdeps/mach/hurd/fstatfs64.c b/sysdeps/mach/hurd/fstatfs64.c
index 364b96e14d..adc4430a4c 100644
--- a/sysdeps/mach/hurd/fstatfs64.c
+++ b/sysdeps/mach/hurd/fstatfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/fstatvfs.c b/sysdeps/mach/hurd/fstatvfs.c
index 4fbf6e5bed..14c8f38145 100644
--- a/sysdeps/mach/hurd/fstatvfs.c
+++ b/sysdeps/mach/hurd/fstatvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <sys/statvfs.h>
diff --git a/sysdeps/mach/hurd/fstatvfs64.c b/sysdeps/mach/hurd/fstatvfs64.c
index f5e03316f4..f421355b87 100644
--- a/sysdeps/mach/hurd/fstatvfs64.c
+++ b/sysdeps/mach/hurd/fstatvfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <sys/statvfs.h>
diff --git a/sysdeps/mach/hurd/fsync.c b/sysdeps/mach/hurd/fsync.c
index d8ae6e0358..278edb9b2b 100644
--- a/sysdeps/mach/hurd/fsync.c
+++ b/sysdeps/mach/hurd/fsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/ftruncate.c b/sysdeps/mach/hurd/ftruncate.c
index 94e17803ac..34d94083ff 100644
--- a/sysdeps/mach/hurd/ftruncate.c
+++ b/sysdeps/mach/hurd/ftruncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/ftruncate64.c b/sysdeps/mach/hurd/ftruncate64.c
index 7a33dd1823..6e3c09f69b 100644
--- a/sysdeps/mach/hurd/ftruncate64.c
+++ b/sysdeps/mach/hurd/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/futimens.c b/sysdeps/mach/hurd/futimens.c
index 4a3943e673..80895f1a55 100644
--- a/sysdeps/mach/hurd/futimens.c
+++ b/sysdeps/mach/hurd/futimens.c
@@ -1,5 +1,5 @@
/* futimens -- change access and modification times of open file. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/futimes.c b/sysdeps/mach/hurd/futimes.c
index 1b521e3e51..da47ff6688 100644
--- a/sysdeps/mach/hurd/futimes.c
+++ b/sysdeps/mach/hurd/futimes.c
@@ -1,5 +1,5 @@
/* futimes -- change access and modification times of open file. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/futimesat.c b/sysdeps/mach/hurd/futimesat.c
index b4939bf644..28b93f8cac 100644
--- a/sysdeps/mach/hurd/futimesat.c
+++ b/sysdeps/mach/hurd/futimesat.c
@@ -1,5 +1,5 @@
/* futimesat -- change access and modification times of file. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/fxstat.c b/sysdeps/mach/hurd/fxstat.c
index f6570af630..b500b528f0 100644
--- a/sysdeps/mach/hurd/fxstat.c
+++ b/sysdeps/mach/hurd/fxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fxstat64.c b/sysdeps/mach/hurd/fxstat64.c
index fcdbb3671e..870a1a9bd8 100644
--- a/sysdeps/mach/hurd/fxstat64.c
+++ b/sysdeps/mach/hurd/fxstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef RTLD_STAT64 /* dl-fxstat64.c, but we don't want it. */
diff --git a/sysdeps/mach/hurd/fxstatat.c b/sysdeps/mach/hurd/fxstatat.c
index 06100d2226..9391cc4763 100644
--- a/sysdeps/mach/hurd/fxstatat.c
+++ b/sysdeps/mach/hurd/fxstatat.c
@@ -1,5 +1,5 @@
/* Get information about file named relative to open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/fxstatat64.c b/sysdeps/mach/hurd/fxstatat64.c
index 909f6f2481..bbf03cde77 100644
--- a/sysdeps/mach/hurd/fxstatat64.c
+++ b/sysdeps/mach/hurd/fxstatat64.c
@@ -1,5 +1,5 @@
/* Get information about file named relative to open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/gai_misc.h b/sysdeps/mach/hurd/gai_misc.h
index 7804139baa..5fc9d1471f 100644
--- a/sysdeps/mach/hurd/gai_misc.h
+++ b/sysdeps/mach/hurd/gai_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <assert.h>
#include <signal.h>
diff --git a/sysdeps/mach/hurd/getclktck.c b/sysdeps/mach/hurd/getclktck.c
index 35458361f4..60b37ce313 100644
--- a/sysdeps/mach/hurd/getclktck.c
+++ b/sysdeps/mach/hurd/getclktck.c
@@ -1,5 +1,5 @@
/* Return run-time value of CLK_TCK for Hurd.
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <time.h>
diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c
index c30b7c507b..4114991144 100644
--- a/sysdeps/mach/hurd/getcwd.c
+++ b/sysdeps/mach/hurd/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
@@ -148,8 +148,8 @@ __hurd_canonicalize_directory_name_internal (file_t thisdir,
dirdata = dirbuf;
dirdatasize = dirbufsize;
while (!(err = __dir_readdir (parent, &dirdata, &dirdatasize,
- direntry, -1, 0, &nentries)) &&
- nentries != 0)
+ direntry, -1, 0, &nentries))
+ && nentries != 0)
{
/* We have a block of directory entries. */
@@ -178,9 +178,9 @@ __hurd_canonicalize_directory_name_internal (file_t thisdir,
offset += d->d_reclen;
/* Ignore `.' and `..'. */
- if (d->d_name[0] == '.' &&
- (d->d_namlen == 1 ||
- (d->d_namlen == 2 && d->d_name[1] == '.')))
+ if (d->d_name[0] == '.'
+ && (d->d_namlen == 1
+ || (d->d_namlen == 2 && d->d_name[1] == '.')))
continue;
if (mount_point || d->d_ino == thisino)
@@ -266,11 +266,6 @@ __hurd_canonicalize_directory_name_internal (file_t thisdir,
So the root is our current directory. */
*--file_namep = '/';
- if (thisid != rootid)
- /* We did not get to our root directory. The returned name should
- not begin with a slash. */
- ++file_namep;
-
memmove (file_name, file_namep, file_name + size - file_namep);
cleanup ();
return file_name;
@@ -309,13 +304,7 @@ __getcwd (char *buf, size_t size)
__USEPORT (CWDIR,
__hurd_canonicalize_directory_name_internal (port,
buf, size));
- if (cwd && cwd[0] != '/')
- {
- /* `cwd' is an unknown root directory. */
- if (buf == NULL)
- free (cwd);
- return __hurd_fail (EGRATUITOUS), NULL;
- }
return cwd;
}
+libc_hidden_def (__getcwd)
weak_alias (__getcwd, getcwd)
diff --git a/sysdeps/mach/hurd/getdomain.c b/sysdeps/mach/hurd/getdomain.c
index dc32228849..aa6282b06a 100644
--- a/sysdeps/mach/hurd/getdomain.c
+++ b/sysdeps/mach/hurd/getdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include "hurdhost.h"
diff --git a/sysdeps/mach/hurd/getdtsz.c b/sysdeps/mach/hurd/getdtsz.c
index 3fb8231d99..b19ed24f0c 100644
--- a/sysdeps/mach/hurd/getdtsz.c
+++ b/sysdeps/mach/hurd/getdtsz.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getegid.c b/sysdeps/mach/hurd/getegid.c
index d232482740..d84ed39d4e 100644
--- a/sysdeps/mach/hurd/getegid.c
+++ b/sysdeps/mach/hurd/getegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getentropy.c b/sysdeps/mach/hurd/getentropy.c
new file mode 100644
index 0000000000..06175d90ce
--- /dev/null
+++ b/sysdeps/mach/hurd/getentropy.c
@@ -0,0 +1,64 @@
+/* Implementation of getentropy based on getrandom.
+ Copyright (C) 2016-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/random.h>
+#include <assert.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on
+ success and -1 on failure. */
+int
+getentropy (void *buffer, size_t length)
+{
+ /* The interface is documented to return EIO for buffer lengths
+ longer than 256 bytes. */
+ if (length > 256)
+ {
+ __set_errno (EIO);
+ return -1;
+ }
+
+ /* Try to fill the buffer completely. Even with the 256 byte limit
+ above, we might still receive an EINTR error (when blocking
+ during boot). */
+ void *end = buffer + length;
+ while (buffer < end)
+ {
+ /* NB: No cancellation point. */
+ ssize_t bytes = __getrandom (buffer, end - buffer, 0);
+ if (bytes < 0)
+ {
+ if (errno == EINTR)
+ /* Try again if interrupted by a signal. */
+ continue;
+ else
+ return -1;
+ }
+ if (bytes == 0)
+ {
+ /* No more bytes available. This should not happen under
+ normal circumstances. */
+ __set_errno (EIO);
+ return -1;
+ }
+ /* Try again in case of a short read. */
+ buffer += bytes;
+ }
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/geteuid.c b/sysdeps/mach/hurd/geteuid.c
index a8c87ccb69..d18e44b7aa 100644
--- a/sysdeps/mach/hurd/geteuid.c
+++ b/sysdeps/mach/hurd/geteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getgid.c b/sysdeps/mach/hurd/getgid.c
index 1e35f9c906..16b3d85985 100644
--- a/sysdeps/mach/hurd/getgid.c
+++ b/sysdeps/mach/hurd/getgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getgroups.c b/sysdeps/mach/hurd/getgroups.c
index ad6babe56d..c2a35d024b 100644
--- a/sysdeps/mach/hurd/getgroups.c
+++ b/sysdeps/mach/hurd/getgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/gethostid.c b/sysdeps/mach/hurd/gethostid.c
index 0cfbb8ae7f..ea4927e413 100644
--- a/sysdeps/mach/hurd/gethostid.c
+++ b/sysdeps/mach/hurd/gethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/gethostname.c b/sysdeps/mach/hurd/gethostname.c
index 41fe0ecc1f..532f86faaa 100644
--- a/sysdeps/mach/hurd/gethostname.c
+++ b/sysdeps/mach/hurd/gethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include "hurdhost.h"
diff --git a/sysdeps/mach/hurd/getitimer.c b/sysdeps/mach/hurd/getitimer.c
index 65ffe9386e..0982357815 100644
--- a/sysdeps/mach/hurd/getitimer.c
+++ b/sysdeps/mach/hurd/getitimer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,14 +13,15 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <errno.h>
#include <sys/time.h>
#include <hurd.h>
+#include <mach.h>
-/* XXX Temporary cheezoid implementation; see __setitmr.c. */
+/* XXX Temporary cheezoid implementation; see setitimer.c. */
/* These are defined in __setitmr.c. */
extern spin_lock_t _hurd_itimer_lock;
@@ -61,8 +62,12 @@ __getitimer (enum __itimer_which which, struct itimerval *value)
}
/* Get the time now. */
- if (__gettimeofday (&elapsed, NULL) < 0)
- return -1;
+ {
+ time_value_t tv;
+ __host_get_time (__mach_host_self (), &tv);
+ elapsed.tv_sec = tv.seconds;
+ elapsed.tv_usec = tv.microseconds;
+ }
/* Extract the current timer setting; and the time it was set, so we can
calculate the time elapsed so far. */
diff --git a/sysdeps/mach/hurd/getlogin.c b/sysdeps/mach/hurd/getlogin.c
index 0ee5a28bc9..ebdccc18eb 100644
--- a/sysdeps/mach/hurd/getlogin.c
+++ b/sysdeps/mach/hurd/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/getlogin_r.c b/sysdeps/mach/hurd/getlogin_r.c
index 79b8271a74..0a24307161 100644
--- a/sysdeps/mach/hurd/getlogin_r.c
+++ b/sysdeps/mach/hurd/getlogin_r.c
@@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Hurd version.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getpeername.c b/sysdeps/mach/hurd/getpeername.c
index dc78538b75..b75e4ff199 100644
--- a/sysdeps/mach/hurd/getpeername.c
+++ b/sysdeps/mach/hurd/getpeername.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/getpgid.c b/sysdeps/mach/hurd/getpgid.c
index 83d14eaa27..d003b0bd97 100644
--- a/sysdeps/mach/hurd/getpgid.c
+++ b/sysdeps/mach/hurd/getpgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getpid.c b/sysdeps/mach/hurd/getpid.c
index a7943def59..f528990980 100644
--- a/sysdeps/mach/hurd/getpid.c
+++ b/sysdeps/mach/hurd/getpid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getppid.c b/sysdeps/mach/hurd/getppid.c
index 212c9607c2..9c65b8a9e2 100644
--- a/sysdeps/mach/hurd/getppid.c
+++ b/sysdeps/mach/hurd/getppid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getpriority.c b/sysdeps/mach/hurd/getpriority.c
index c581ddd10f..6d14eca727 100644
--- a/sysdeps/mach/hurd/getpriority.c
+++ b/sysdeps/mach/hurd/getpriority.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <limits.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/getrandom.c b/sysdeps/mach/hurd/getrandom.c
new file mode 100644
index 0000000000..8bf42aa40d
--- /dev/null
+++ b/sysdeps/mach/hurd/getrandom.c
@@ -0,0 +1,46 @@
+/* Hurdish implementation of getrandom
+ Copyright (C) 2016-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/random.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <not-cancel.h>
+
+/* Write up to LENGTH bytes of randomness starting at BUFFER.
+ Return the number of bytes written, or -1 on error. */
+ssize_t
+__getrandom (void *buffer, size_t length, unsigned int flags)
+{
+ const char *random_source = "/dev/urandom";
+ size_t amount_read;
+ int fd;
+
+ if (flags & GRND_RANDOM)
+ random_source = "/dev/random";
+
+ fd = __open_nocancel(random_source, O_RDONLY | O_CLOEXEC);
+ if (fd == -1)
+ return -1;
+
+ amount_read = __read_nocancel(fd, buffer, length);
+ __close_nocancel_nostatus(fd);
+ return amount_read;
+}
+
+libc_hidden_def (__getrandom)
+weak_alias (__getrandom, getrandom)
diff --git a/sysdeps/mach/hurd/getresgid.c b/sysdeps/mach/hurd/getresgid.c
index e5eeba8ac5..ed37877f99 100644
--- a/sysdeps/mach/hurd/getresgid.c
+++ b/sysdeps/mach/hurd/getresgid.c
@@ -1,5 +1,5 @@
/* getresgid -- fetch real group ID, effective group ID, and saved-set group ID
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getresuid.c b/sysdeps/mach/hurd/getresuid.c
index 4af4786fc5..fdb61a3af5 100644
--- a/sysdeps/mach/hurd/getresuid.c
+++ b/sysdeps/mach/hurd/getresuid.c
@@ -1,5 +1,5 @@
/* getresuid -- fetch real user ID, effective user ID, and saved-set user ID
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getrlimit.c b/sysdeps/mach/hurd/getrlimit.c
index 5b994c59a7..ed93841433 100644
--- a/sysdeps/mach/hurd/getrlimit.c
+++ b/sysdeps/mach/hurd/getrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/resource.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/getrusage.c b/sysdeps/mach/hurd/getrusage.c
index dfda2b7e1b..3b2f07741d 100644
--- a/sysdeps/mach/hurd/getrusage.c
+++ b/sysdeps/mach/hurd/getrusage.c
@@ -1,5 +1,5 @@
/* getrusage -- Get resource usage information about processes. Hurd version.
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/getsid.c b/sysdeps/mach/hurd/getsid.c
index ae0e0a96bd..cb4a49dad6 100644
--- a/sysdeps/mach/hurd/getsid.c
+++ b/sysdeps/mach/hurd/getsid.c
@@ -1,5 +1,5 @@
/* getsid -- Return session ID of a process. Hurd version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getsockname.c b/sysdeps/mach/hurd/getsockname.c
index 2e56564824..3b7c938717 100644
--- a/sysdeps/mach/hurd/getsockname.c
+++ b/sysdeps/mach/hurd/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/getsockopt.c b/sysdeps/mach/hurd/getsockopt.c
index 364a622188..a2ac8da38f 100644
--- a/sysdeps/mach/hurd/getsockopt.c
+++ b/sysdeps/mach/hurd/getsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/getuid.c b/sysdeps/mach/hurd/getuid.c
index 80acbd4987..b069044ce2 100644
--- a/sysdeps/mach/hurd/getuid.c
+++ b/sysdeps/mach/hurd/getuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/getxattr.c b/sysdeps/mach/hurd/getxattr.c
index 3463bdfcb2..3fd973c88f 100644
--- a/sysdeps/mach/hurd/getxattr.c
+++ b/sysdeps/mach/hurd/getxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/group_member.c b/sysdeps/mach/hurd/group_member.c
index 5b4be63218..248fd92264 100644
--- a/sysdeps/mach/hurd/group_member.c
+++ b/sysdeps/mach/hurd/group_member.c
@@ -1,5 +1,5 @@
/* `group_member' -- test if process is in a given group. Hurd version.
- Copyright (C) 1993-2018 Free Software Foundation, Inc.
+ Copyright (C) 1993-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/hp-timing.h b/sysdeps/mach/hurd/hp-timing.h
index 7bff90cb93..fd6914060a 100644
--- a/sysdeps/mach/hurd/hp-timing.h
+++ b/sysdeps/mach/hurd/hp-timing.h
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. Generic version.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* We don't have support for high precision timing for now. */
#include <sysdeps/generic/hp-timing.h>
diff --git a/sysdeps/mach/hurd/htl/bits/pthread-np.h b/sysdeps/mach/hurd/htl/bits/pthread-np.h
index e42fb3a038..6ed2240741 100644
--- a/sysdeps/mach/hurd/htl/bits/pthread-np.h
+++ b/sysdeps/mach/hurd/htl/bits/pthread-np.h
@@ -1,5 +1,5 @@
/* Non-portable functions. Hurd on Mach version.
- Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Copyright (C) 2008-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/*
* Never include this file directly; use <pthread.h> or <cthreads.h> instead.
diff --git a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h
index 8417ee9531..25de7c3c06 100644
--- a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h
+++ b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h
@@ -1,5 +1,5 @@
/* Mutex type. Generic version.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H
#define _BITS_TYPES_STRUCT___PTHREAD_MUTEX_H 1
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
index ff6bee83d0..b2eaa7b535 100644
--- a/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
@@ -1,5 +1,5 @@
/* pthread_attr_setstackaddr. Hurd on Mach version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <pt-internal.h>
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
index e5c59d14b4..bcb12df0e5 100644
--- a/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
@@ -1,5 +1,5 @@
/* pthread_attr_setstacksize. Hurd on Mach version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <pt-internal.h>
diff --git a/sysdeps/mach/hurd/htl/pt-docancel.c b/sysdeps/mach/hurd/htl/pt-docancel.c
index 6e9428ce57..0cd5bf4c7a 100644
--- a/sysdeps/mach/hurd/htl/pt-docancel.c
+++ b/sysdeps/mach/hurd/htl/pt-docancel.c
@@ -1,5 +1,5 @@
/* Cancel a thread.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
diff --git a/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c b/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
index 263d3bfd27..aa3eb9884c 100644
--- a/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
+++ b/sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
@@ -1,5 +1,5 @@
/* pthread_hurd_cond_timedwait_np. Hurd-specific wait on a condition.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -14,11 +14,12 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <assert.h>
#include <hurd/signal.h>
+#include <time.h>
#include <pt-internal.h>
@@ -69,7 +70,7 @@ __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond,
assert (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */
- if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000))
+ if (abstime != NULL && ! valid_nanoseconds (abstime->tv_nsec))
return EINVAL;
/* Atomically enqueue our thread on the condition variable's queue of
diff --git a/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c b/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c
index 067bd667e7..dd69b76861 100644
--- a/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c
+++ b/sysdeps/mach/hurd/htl/pt-hurd-cond-wait.c
@@ -1,5 +1,5 @@
/* pthread_hurd_cond_wait. Hurd-specific wait on a condition.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <assert.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
index e02f959a57..1ed7f874f0 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-consistent.c
@@ -1,5 +1,5 @@
/* pthread_mutex_consistent. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -29,11 +29,11 @@ pthread_mutex_consistent (pthread_mutex_t *mtxp)
int ret = EINVAL;
unsigned int val = mtxp->__lock;
- if ((mtxp->__flags & PTHREAD_MUTEX_ROBUST) != 0 &&
- (val & LLL_DEAD_OWNER) != 0 &&
- atomic_compare_and_exchange_bool_acq (&mtxp->__lock,
- __getpid () | LLL_WAITERS,
- val) == 0)
+ if ((mtxp->__flags & PTHREAD_MUTEX_ROBUST) != 0
+ && (val & LLL_DEAD_OWNER) != 0
+ && atomic_compare_and_exchange_bool_acq (&mtxp->__lock,
+ __getpid () | LLL_WAITERS,
+ val) == 0)
{
/* The mutex is now ours, and it's consistent. */
mtxp->__owner_id = _pthread_self ()->thread;
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c
index 7e7c4bd7a7..471cef55b3 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c
@@ -1,5 +1,5 @@
/* pthread_mutex_destroy. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c
index e52da9cad2..048292a2c0 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-getprioceiling.c
@@ -1,5 +1,5 @@
/* pthread_mutex_getprioceiling. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-init.c b/sysdeps/mach/hurd/htl/pt-mutex-init.c
index 687a4c0e67..d88cbda98d 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-init.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-init.c
@@ -1,5 +1,5 @@
/* pthread_mutex_init. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -37,13 +37,13 @@ _pthread_mutex_init (pthread_mutex_t *mtxp, const pthread_mutexattr_t *attrp)
if (attrp == NULL)
attrp = &dfl_attr;
- mtxp->__flags = (attrp->__pshared == PTHREAD_PROCESS_SHARED ?
- GSYNC_SHARED : 0) | ((attrp->
- __prioceiling & PTHREAD_MUTEX_ROBUST) ?
- PTHREAD_MUTEX_ROBUST : 0);
+ mtxp->__flags = (attrp->__pshared == PTHREAD_PROCESS_SHARED
+ ? GSYNC_SHARED : 0) | ((attrp->__prioceiling
+ & PTHREAD_MUTEX_ROBUST)
+ ? PTHREAD_MUTEX_ROBUST : 0);
- mtxp->__type = attrp->__mutex_type +
- (attrp->__mutex_type != __PTHREAD_MUTEX_TIMED);
+ mtxp->__type = (attrp->__mutex_type
+ + (attrp->__mutex_type != __PTHREAD_MUTEX_TIMED));
mtxp->__owner_id = 0;
mtxp->__shpid = 0;
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-lock.c b/sysdeps/mach/hurd/htl/pt-mutex-lock.c
index a7f1537756..843a31e8b1 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-lock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-lock.c
@@ -1,5 +1,5 @@
/* pthread_mutex_lock. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c
index c06520a83d..cb228455e5 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-setprioceiling.c
@@ -1,5 +1,5 @@
/* pthread_mutex_setprioceiling. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
index f804ac08ad..e910e66325 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
@@ -1,5 +1,5 @@
/* pthread_mutex_timedlock. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c
index f6281292ab..d1eb35df33 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c
@@ -1,6 +1,6 @@
/* pthread_mutex_transfer_np. Transfer mutex ownership to another thread.
Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -58,8 +58,8 @@ __pthread_mutex_transfer_np (pthread_mutex_t *mtxp, pthread_t th)
/* Note that this can be used to transfer an inconsistent
* mutex as well. The new owner will still have the same
* flags as the original. */
- if (mtxp->__owner_id != self->thread ||
- (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
+ if (mtxp->__owner_id != self->thread
+ || (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
ret = EPERM;
else
mtxp->__owner_id = pt->thread;
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c
index 9828d783c1..3a686162ad 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-trylock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-trylock.c
@@ -1,5 +1,5 @@
/* pthread_mutex_trylock. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c
index 1699234420..15d19c91eb 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-unlock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-unlock.c
@@ -1,5 +1,5 @@
/* pthread_mutex_unlock. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -65,15 +65,15 @@ __pthread_mutex_unlock (pthread_mutex_t *mtxp)
self = _pthread_self ();
if (mtxp->__owner_id == NOTRECOVERABLE_ID)
; /* Nothing to do. */
- else if (mtxp->__owner_id != self->thread ||
- (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
+ else if (mtxp->__owner_id != self->thread
+ || (int) (mtxp->__lock & LLL_OWNER_MASK) != __getpid ())
ret = EPERM;
else if (--mtxp->__cnt == 0)
{
/* Release the lock. If it's in an inconsistent
* state, mark it as irrecoverable. */
- mtxp->__owner_id = (mtxp->__lock & LLL_DEAD_OWNER) ?
- NOTRECOVERABLE_ID : 0;
+ mtxp->__owner_id = ((mtxp->__lock & LLL_DEAD_OWNER)
+ ? NOTRECOVERABLE_ID : 0);
__lll_robust_unlock (&mtxp->__lock, flags);
}
diff --git a/sysdeps/mach/hurd/htl/pt-mutex.h b/sysdeps/mach/hurd/htl/pt-mutex.h
index 4fc7259513..8bec1c1c2a 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex.h
+++ b/sysdeps/mach/hurd/htl/pt-mutex.h
@@ -1,5 +1,5 @@
/* Internal definitions for pthreads library.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _PT_MUTEX_H
#define _PT_MUTEX_H 1
@@ -27,8 +27,8 @@
#define ROBUST_LOCK(self, mtxp, cb, ...) \
if (mtxp->__owner_id == NOTRECOVERABLE_ID) \
return ENOTRECOVERABLE; \
- else if (mtxp->__owner_id == self->thread && \
- __getpid () == (int)(mtxp->__lock & LLL_OWNER_MASK)) \
+ else if (mtxp->__owner_id == self->thread \
+ && __getpid () == (int)(mtxp->__lock & LLL_OWNER_MASK)) \
{ \
if (mtxp->__type == PT_MTX_RECURSIVE) \
{ \
@@ -63,9 +63,9 @@
/* Check that a thread owns the mutex. For non-robust, task-shared
* objects, we have to check the thread *and* process-id. */
#define mtx_owned_p(mtx, pt, flags) \
- ((mtx)->__owner_id == (pt)->thread && \
- (((flags) & GSYNC_SHARED) == 0 || \
- (mtx)->__shpid == __getpid ()))
+ ((mtx)->__owner_id == (pt)->thread \
+ && (((flags) & GSYNC_SHARED) == 0 \
+ || (mtx)->__shpid == __getpid ()))
/* Record a thread as the owner of the mutex. */
#define mtx_set_owner(mtx, pt, flags) \
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c b/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c
index de8de0f2a5..21a2f1aa71 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-destroy.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_destroy. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c
index 8c6c748a40..f363a1587d 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getprioceiling.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_getprioceiling. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c
index f0f9edcf47..9ebf14b878 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getprotocol.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_getprotocol. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c
index eb162beee8..878ed67e38 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getpshared.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_getpshared. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c b/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c
index 5325e070fe..72f0e2269a 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_getrobust. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -26,8 +26,8 @@
int
pthread_mutexattr_getrobust (const pthread_mutexattr_t *attrp, int *outp)
{
- *outp = (attrp->__prioceiling & PTHREAD_MUTEX_ROBUST) ?
- PTHREAD_MUTEX_ROBUST : PTHREAD_MUTEX_STALLED;
+ *outp = ((attrp->__prioceiling & PTHREAD_MUTEX_ROBUST)
+ ? PTHREAD_MUTEX_ROBUST : PTHREAD_MUTEX_STALLED);
return 0;
}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c b/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c
index 78b7462895..30aba6830f 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-gettype.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_gettype. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-init.c b/sysdeps/mach/hurd/htl/pt-mutexattr-init.c
index c96afdc26d..627b834ef8 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-init.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-init.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_init. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c
index f93cdef38d..1286b370b1 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setprioceiling.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_setprioceiling. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
index f971b5bc5f..cdf5a21957 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_setprotocol. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -27,7 +27,8 @@ int
pthread_mutexattr_setprotocol (pthread_mutexattr_t *attrp, int proto)
{
(void) attrp;
- return proto == PTHREAD_PRIO_NONE ? 0 :
- proto != PTHREAD_PRIO_INHERIT &&
- proto != PTHREAD_PRIO_PROTECT ? EINVAL : ENOTSUP;
+ return (proto == PTHREAD_PRIO_NONE
+ ? 0
+ : (proto != PTHREAD_PRIO_INHERIT
+ && proto != PTHREAD_PRIO_PROTECT) ? EINVAL : ENOTSUP);
}
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c
index 6bed94fbce..a6c23efcf1 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_setpshared. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
@@ -32,3 +32,4 @@ pthread_mutexattr_setpshared (pthread_mutexattr_t *attrp, int pshared)
attrp->__pshared = pshared;
return 0;
}
+stub_warning (pthread_mutexattr_setpshared)
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c b/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c
index b1baf6cbf8..95371a8837 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-setrobust.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_setrobust. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c b/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c
index 56b58887c1..0a972bef4f 100644
--- a/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c
+++ b/sysdeps/mach/hurd/htl/pt-mutexattr-settype.c
@@ -1,5 +1,5 @@
/* pthread_mutexattr_settype. Hurd version.
- Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c b/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c
index e7154a371d..02868a03c5 100644
--- a/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c
+++ b/sysdeps/mach/hurd/htl/pt-sigstate-destroy.c
@@ -1,5 +1,5 @@
/* Destroy the signal state. Hurd on Mach version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate-init.c b/sysdeps/mach/hurd/htl/pt-sigstate-init.c
index 70832f9576..97bf0c3a78 100644
--- a/sysdeps/mach/hurd/htl/pt-sigstate-init.c
+++ b/sysdeps/mach/hurd/htl/pt-sigstate-init.c
@@ -1,5 +1,5 @@
/* Initialize the signal state. Hurd on Mach version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <pt-internal.h>
diff --git a/sysdeps/mach/hurd/htl/pt-sigstate.c b/sysdeps/mach/hurd/htl/pt-sigstate.c
index f7050ec0df..845152ee48 100644
--- a/sysdeps/mach/hurd/htl/pt-sigstate.c
+++ b/sysdeps/mach/hurd/htl/pt-sigstate.c
@@ -1,5 +1,5 @@
/* Set a thread's signal state. Hurd on Mach version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <pthread.h>
#include <assert.h>
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c
index 673f048c37..509e848639 100644
--- a/sysdeps/mach/hurd/htl/pt-sysdep.c
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.c
@@ -1,5 +1,5 @@
/* System dependent pthreads code. Hurd version.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <assert.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.h b/sysdeps/mach/hurd/htl/pt-sysdep.h
index 5b15223da8..186192c7f4 100644
--- a/sysdeps/mach/hurd/htl/pt-sysdep.h
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.h
@@ -1,5 +1,5 @@
/* Internal definitions for pthreads library.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _PT_SYSDEP_H
#define _PT_SYSDEP_H 1
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index 9a824fadf3..8404eb086c 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -87,6 +87,10 @@ test-xfail-XOPEN2K8/sys/socket.h/conform = yes
test-xfail-XOPEN2K8/sys/types.h/conform = yes
test-xfail-XOPEN2K8/stdlib.h/conform = yes
test-xfail-XOPEN2K8/arpa/inet.h/conform = yes
+
+# For bug 23819
+test-xfail-ISO11/threads.h/linknamespace = yes
+test-xfail-ISO11/threads.h/conform = yes
endif
# For bug 23286
diff --git a/sysdeps/mach/hurd/i386/____longjmp_chk.S b/sysdeps/mach/hurd/i386/____longjmp_chk.S
index 7c3a73adba..a70d6ce1d3 100644
--- a/sysdeps/mach/hurd/i386/____longjmp_chk.S
+++ b/sysdeps/mach/hurd/i386/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <jmpbuf-offsets.h>
diff --git a/sysdeps/mach/hurd/i386/bits/sigcontext.h b/sysdeps/mach/hurd/i386/bits/sigcontext.h
index f493bc9750..9adc4db319 100644
--- a/sysdeps/mach/hurd/i386/bits/sigcontext.h
+++ b/sysdeps/mach/hurd/i386/bits/sigcontext.h
@@ -1,5 +1,5 @@
/* Machine-dependent signal context structure for GNU Hurd. i386 version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _BITS_SIGCONTEXT_H
#define _BITS_SIGCONTEXT_H 1
diff --git a/sysdeps/mach/hurd/i386/exc2signal.c b/sysdeps/mach/hurd/i386/exc2signal.c
index 57bc05df99..48ed1def1d 100644
--- a/sysdeps/mach/hurd/i386/exc2signal.c
+++ b/sysdeps/mach/hurd/i386/exc2signal.c
@@ -1,5 +1,5 @@
/* Translate Mach exception codes into signal numbers. i386 version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <hurd.h>
#include <hurd/signal.h>
diff --git a/sysdeps/mach/hurd/i386/htl/pt-machdep.c b/sysdeps/mach/hurd/i386/htl/pt-machdep.c
index 2e35a095ab..f6cb1a1648 100644
--- a/sysdeps/mach/hurd/i386/htl/pt-machdep.c
+++ b/sysdeps/mach/hurd/i386/htl/pt-machdep.c
@@ -1,5 +1,5 @@
/* Machine dependent pthreads code. Hurd/i386 version.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
diff --git a/sysdeps/mach/hurd/i386/htl/pt-setup.c b/sysdeps/mach/hurd/i386/htl/pt-setup.c
index e10d38a842..4d395e56a8 100644
--- a/sysdeps/mach/hurd/i386/htl/pt-setup.c
+++ b/sysdeps/mach/hurd/i386/htl/pt-setup.c
@@ -1,5 +1,5 @@
/* Setup thread stack. Hurd/i386 version.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stdint.h>
#include <assert.h>
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f8ad2ceb8e..5c21ebb958 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. For i386/Hurd.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <assert.h>
#include <ctype.h>
@@ -30,6 +30,7 @@
#include <ldsodefs.h>
#include <fpu_control.h>
+#include <libc-diag.h>
extern void __mach_init (void);
extern void __init_misc (int, char **, char **);
@@ -126,8 +127,8 @@ init1 (int argc, char *arg0, ...)
char dummy;
const vm_address_t newsp = (vm_address_t) &dummy;
- if (d->stack_size != 0 && (newsp < d->stack_base ||
- newsp - d->stack_base > d->stack_size))
+ if (d->stack_size != 0 && (newsp < d->stack_base
+ || newsp - d->stack_base > d->stack_size))
/* The new stack pointer does not intersect with the
stack the exec server set up for us, so free that stack. */
__vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size);
@@ -144,6 +145,12 @@ init1 (int argc, char *arg0, ...)
static inline void
init (int *data)
{
+ /* data is the address of the argc parameter to _dl_init_first or
+ doinit1 in _hurd_stack_setup, so the array subscripts are
+ undefined. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (10, "-Warray-bounds");
+
int argc = *data;
char **argv = (void *) (data + 1);
char **envp = &argv[argc + 1];
@@ -265,6 +272,8 @@ init (int *data)
restored by function return. */
asm volatile ("# a %0 c %1" : : "a" (usercode), "c" (&init1));
}
+
+ DIAG_POP_NEEDS_COMMENT; /* -Warray-bounds. */
}
/* These bits of inline assembler used to be located inside `init'.
@@ -361,7 +370,7 @@ _hurd_stack_setup (void)
*--data = caller;
asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack. */
"movl $0, %%ebp\n" /* Clear outermost frame pointer. */
- "jmp *%1" : : "r" (data), "r" (&doinit1) : "sp");
+ "jmp *%1" : : "r" (data), "r" (&doinit1));
/* NOTREACHED */
}
diff --git a/sysdeps/mach/hurd/i386/intr-msg.h b/sysdeps/mach/hurd/i386/intr-msg.h
index 64f05f8c4e..69393ae87c 100644
--- a/sysdeps/mach/hurd/i386/intr-msg.h
+++ b/sysdeps/mach/hurd/i386/intr-msg.h
@@ -1,5 +1,5 @@
/* Machine-dependent details of interruptible RPC messaging. i386 version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,27 +14,36 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Note that we must mark OPTION and TIMEOUT as outputs of this operation,
to indicate that the signal thread might mutate them as part
of sending us to a signal handler. */
-#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify) \
+
+/* After _hurd_intr_rpc_msg_about_to we need to make a last check of cancel, in
+ case we got interrupted right before _hurd_intr_rpc_msg_about_to. */
+#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify, cancel_p, intr_port_p) \
({ \
error_t err; \
- asm (".globl _hurd_intr_rpc_msg_do_trap\n" \
- ".globl _hurd_intr_rpc_msg_in_trap\n" \
+ asm (".globl _hurd_intr_rpc_msg_about_to\n" \
".globl _hurd_intr_rpc_msg_cx_sp\n" \
+ ".globl _hurd_intr_rpc_msg_do_trap\n" \
+ ".globl _hurd_intr_rpc_msg_in_trap\n" \
".globl _hurd_intr_rpc_msg_sp_restored\n" \
- " movl %%esp, %%ecx\n" \
- " leal %3, %%esp\n" \
+ "_hurd_intr_rpc_msg_about_to: cmpl $0, %5\n" \
+ " jz _hurd_intr_rpc_msg_do\n" \
+ " movl $0, %3\n" \
+ " movl %6, %%eax\n" \
+ " jmp _hurd_intr_rpc_msg_sp_restored\n" \
+ "_hurd_intr_rpc_msg_do: movl %%esp, %%ecx\n" \
+ " leal %4, %%esp\n" \
"_hurd_intr_rpc_msg_cx_sp: movl $-25, %%eax\n" \
"_hurd_intr_rpc_msg_do_trap: lcall $7, $0 # status in %0\n" \
"_hurd_intr_rpc_msg_in_trap: movl %%ecx, %%esp\n" \
"_hurd_intr_rpc_msg_sp_restored:" \
- : "=a" (err), "+m" (option), "+m" (timeout) \
- : "m" ((&msg)[-1]) \
+ : "=a" (err), "+m" (option), "+m" (timeout), "=m" (*intr_port_p) \
+ : "m" ((&msg)[-1]), "m" (*cancel_p), "i" (EINTR) \
: "ecx"); \
err; \
})
diff --git a/sysdeps/mach/hurd/i386/ioperm.c b/sysdeps/mach/hurd/i386/ioperm.c
index 6f22a88490..a8e68c3a41 100644
--- a/sysdeps/mach/hurd/i386/ioperm.c
+++ b/sysdeps/mach/hurd/i386/ioperm.c
@@ -1,5 +1,5 @@
/* Access to hardware i/o ports. Hurd/x86 version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/io.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index e3fc05137b..7c2cb2b05a 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -554,7 +554,7 @@ GLIBC_2.2.6 __xstat64 F
GLIBC_2.2.6 _authenticate F
GLIBC_2.2.6 _dl_mcount_wrapper F
GLIBC_2.2.6 _dl_mcount_wrapper_check F
-GLIBC_2.2.6 _end GLIBC_2.2.6 g ? D .bss 00000000
+GLIBC_2.2.6 _end D 0x0
GLIBC_2.2.6 _environ D 0x4
GLIBC_2.2.6 _exit F
GLIBC_2.2.6 _flushlbf F
@@ -711,6 +711,11 @@ GLIBC_2.2.6 clntudp_bufcreate F
GLIBC_2.2.6 clntudp_create F
GLIBC_2.2.6 clntunix_create F
GLIBC_2.2.6 clock F
+GLIBC_2.2.6 clock_getcpuclockid F
+GLIBC_2.2.6 clock_getres F
+GLIBC_2.2.6 clock_gettime F
+GLIBC_2.2.6 clock_nanosleep F
+GLIBC_2.2.6 clock_settime F
GLIBC_2.2.6 close F
GLIBC_2.2.6 closedir F
GLIBC_2.2.6 closelog F
@@ -2038,6 +2043,9 @@ GLIBC_2.27 wcstof64x_l F
GLIBC_2.28 fcntl64 F
GLIBC_2.28 renameat2 F
GLIBC_2.28 statx F
+GLIBC_2.29 _hurd_port_move F
+GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
+GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
GLIBC_2.3 __ctype_toupper_loc F
@@ -2172,6 +2180,7 @@ GLIBC_2.3.4 setipv4sourcefilter F
GLIBC_2.3.4 setsourcefilter F
GLIBC_2.3.4 xdr_quad_t F
GLIBC_2.3.4 xdr_u_quad_t F
+GLIBC_2.30 twalk_r F
GLIBC_2.4 __confstr_chk F
GLIBC_2.4 __fgets_chk F
GLIBC_2.4 __fgets_unlocked_chk F
diff --git a/sysdeps/mach/hurd/i386/libm.abilist b/sysdeps/mach/hurd/i386/libm.abilist
index fd0a277bdc..1a41ae589f 100644
--- a/sysdeps/mach/hurd/i386/libm.abilist
+++ b/sysdeps/mach/hurd/i386/libm.abilist
@@ -1068,3 +1068,24 @@ GLIBC_2.28 fmul F
GLIBC_2.28 fmull F
GLIBC_2.28 fsub F
GLIBC_2.28 fsubl F
+GLIBC_2.29 exp F
+GLIBC_2.29 exp2 F
+GLIBC_2.29 log F
+GLIBC_2.29 log2 F
+GLIBC_2.29 pow F
+GLIBC_2.31 totalorder F
+GLIBC_2.31 totalorderf F
+GLIBC_2.31 totalorderf128 F
+GLIBC_2.31 totalorderf32 F
+GLIBC_2.31 totalorderf32x F
+GLIBC_2.31 totalorderf64 F
+GLIBC_2.31 totalorderf64x F
+GLIBC_2.31 totalorderl F
+GLIBC_2.31 totalordermag F
+GLIBC_2.31 totalordermagf F
+GLIBC_2.31 totalordermagf128 F
+GLIBC_2.31 totalordermagf32 F
+GLIBC_2.31 totalordermagf32x F
+GLIBC_2.31 totalordermagf64 F
+GLIBC_2.31 totalordermagf64x F
+GLIBC_2.31 totalordermagl F
diff --git a/sysdeps/mach/hurd/i386/librt.abilist b/sysdeps/mach/hurd/i386/librt.abilist
index d5fe32b3a9..3726e41f06 100644
--- a/sysdeps/mach/hurd/i386/librt.abilist
+++ b/sysdeps/mach/hurd/i386/librt.abilist
@@ -13,11 +13,6 @@ GLIBC_2.2.6 aio_suspend F
GLIBC_2.2.6 aio_suspend64 F
GLIBC_2.2.6 aio_write F
GLIBC_2.2.6 aio_write64 F
-GLIBC_2.2.6 clock_getcpuclockid F
-GLIBC_2.2.6 clock_getres F
-GLIBC_2.2.6 clock_gettime F
-GLIBC_2.2.6 clock_nanosleep F
-GLIBC_2.2.6 clock_settime F
GLIBC_2.2.6 lio_listio F
GLIBC_2.2.6 lio_listio64 F
GLIBC_2.2.6 shm_open F
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
index a5b5241b84..b89e04b24a 100644
--- a/sysdeps/mach/hurd/i386/localplt.data
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -32,14 +32,15 @@ ld.so: __libc_lseek64
ld.so: __mmap
ld.so: __fxstat64
ld.so: __xstat64
-#ld.so: __access
+ld.so: __access
ld.so: __access_noerrno
ld.so: __getpid
-#ld.so: __getcwd
+ld.so: __getcwd
ld.so: __sbrk
ld.so: __strtoul_internal
#ld.so: _exit
ld.so: abort
+ld.so: __sigprocmask
ld.so: _hurd_intr_rpc_mach_msg
ld.so: __errno_location
# rtld_hidden is currently disabled to avoid having to special-case the
diff --git a/sysdeps/mach/hurd/i386/longjmp-ts.c b/sysdeps/mach/hurd/i386/longjmp-ts.c
index 37ac78ce5d..c7732c66a1 100644
--- a/sysdeps/mach/hurd/i386/longjmp-ts.c
+++ b/sysdeps/mach/hurd/i386/longjmp-ts.c
@@ -1,5 +1,5 @@
/* Perform a `longjmp' on a Mach thread_state. i386 version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <hurd/signal.h>
#include <setjmp.h>
diff --git a/sysdeps/mach/hurd/i386/sigcontextinfo.h b/sysdeps/mach/hurd/i386/sigcontextinfo.h
index 836ecb227f..42004f0041 100644
--- a/sysdeps/mach/hurd/i386/sigcontextinfo.h
+++ b/sysdeps/mach/hurd/i386/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,16 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SIGCONTEXTINFO_H
+#define _SIGCONTEXTINFO_H
#define SIGCONTEXT struct sigcontext
-#define GET_PC(ctx) ((void *) (ctx).sc_eip)
+static inline uintptr_t
+sigcontext_get_pc (struct sigcontext ctx)
+{
+ return ctx.sc_eip;
+}
+
+#endif
diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c
index 07633e17c8..a2bb6d0dfb 100644
--- a/sysdeps/mach/hurd/i386/sigreturn.c
+++ b/sysdeps/mach/hurd/i386/sigreturn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
register int *sp asm ("%esp");
@@ -24,6 +24,36 @@ register int *sp asm ("%esp");
#include <stdlib.h>
#include <string.h>
+/* This is run on the thread stack after restoring it, to be able to
+ unlock SS off sigstack. */
+static void
+__sigreturn2 (int *usp)
+{
+ struct hurd_sigstate *ss = _hurd_self_sigstate ();
+ __spin_unlock (&ss->lock);
+
+ sp = usp;
+#define A(line) asm volatile (#line)
+ /* The members in the sigcontext are arranged in this order
+ so we can pop them easily. */
+
+ /* Pop the segment registers (except %cs and %ss, done last). */
+ A (popl %gs);
+ A (popl %fs);
+ A (popl %es);
+ A (popl %ds);
+ /* Pop the general registers. */
+ A (popa);
+ /* Pop the processor flags. */
+ A (popf);
+ /* Return to the saved PC. */
+ A (ret);
+
+ /* Firewall. */
+ A (hlt);
+#undef A
+}
+
int
__sigreturn (struct sigcontext *scp)
{
@@ -67,13 +97,7 @@ __sigreturn (struct sigcontext *scp)
}
if (scp->sc_onstack)
- {
- ss->sigaltstack.ss_flags &= ~SS_ONSTACK;
- /* XXX cannot unlock until off sigstack */
- abort ();
- }
- else
- __spin_unlock (&ss->lock);
+ ss->sigaltstack.ss_flags &= ~SS_ONSTACK;
/* Destroy the MiG reply port used by the signal handler, and restore the
reply port in use by the thread when interrupted. */
@@ -108,27 +132,19 @@ __sigreturn (struct sigcontext *scp)
*--usp = scp->sc_efl;
memcpy (usp -= 12, &scp->sc_i386_thread_state, 12 * sizeof (int));
- sp = usp;
-
-#define A(line) asm volatile (#line)
- /* The members in the sigcontext are arranged in this order
- so we can pop them easily. */
-
- /* Pop the segment registers (except %cs and %ss, done last). */
- A (popl %gs);
- A (popl %fs);
- A (popl %es);
- A (popl %ds);
- /* Pop the general registers. */
- A (popa);
- /* Pop the processor flags. */
- A (popf);
- /* Return to the saved PC. */
- A (ret);
+ /* Pass usp to __sigreturn2 so it can unwind itself easily. */
+ *(usp-1) = (int) usp;
+ --usp;
+ /* Bogus return address for __sigreturn2 */
+ *--usp = 0;
+ *--usp = (int) __sigreturn2;
+ /* Restore thread stack */
+ sp = usp;
+ /* Return into __sigreturn2. */
+ asm volatile ("ret");
/* Firewall. */
- A (hlt);
-#undef A
+ asm volatile ("hlt");
}
/* NOTREACHED */
diff --git a/sysdeps/mach/hurd/i386/static-start.S b/sysdeps/mach/hurd/i386/static-start.S
index 1df95a0a18..2f7fdbe89f 100644
--- a/sysdeps/mach/hurd/i386/static-start.S
+++ b/sysdeps/mach/hurd/i386/static-start.S
@@ -1,5 +1,5 @@
/* Startup code for statically linked Hurd/i386 binaries.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
.text
.globl _start
diff --git a/sysdeps/mach/hurd/i386/sys/io.h b/sysdeps/mach/hurd/i386/sys/io.h
index 81165f00a1..be6a2b3716 100644
--- a/sysdeps/mach/hurd/i386/sys/io.h
+++ b/sysdeps/mach/hurd/i386/sys/io.h
@@ -1,5 +1,5 @@
/* Access to hardware i/o ports. GNU/x86 version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _SYS_IO_H
#define _SYS_IO_H 1
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index da1f7b78da..11b2760a44 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd/i386 version.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _I386_TLS_H
#define _I386_TLS_H
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c
index 0e795f9389..0c5d5a194c 100644
--- a/sysdeps/mach/hurd/i386/trampoline.c
+++ b/sysdeps/mach/hurd/i386/trampoline.c
@@ -1,5 +1,5 @@
/* Set thread_state for sighandler, and sigcontext to recover. i386 version.
- Copyright (C) 1994-2018 Free Software Foundation, Inc.
+ Copyright (C) 1994-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <hurd/signal.h>
#include <hurd/userlink.h>
@@ -74,12 +74,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
interrupted RPC frame. */
state->basic.esp = state->basic.uesp;
- if ((ss->actions[signo].sa_flags & SA_ONSTACK) &&
- !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK)))
- {
- sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size;
- ss->sigaltstack.ss_flags |= SS_ONSTACK;
- }
/* This code has intimate knowledge of the special mach_msg system call
done in intr-msg.c; that code does (see intr-msg.h):
movl %esp, %ecx
@@ -91,13 +85,20 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
We must check for the window during which %esp points at the
mach_msg arguments. The space below until %ecx is used by
the _hurd_intr_rpc_mach_msg frame, and must not be clobbered. */
- else if (state->basic.eip >= (int) &_hurd_intr_rpc_msg_cx_sp &&
- state->basic.eip < (int) &_hurd_intr_rpc_msg_sp_restored)
- /* The SP now points at the mach_msg args, but there is more stack
- space used below it. The real SP is saved in %ecx; we must push the
- new frame below there, and restore that value as the SP on
- sigreturn. */
- sigsp = (char *) (state->basic.uesp = state->basic.ecx);
+ if (state->basic.eip >= (int) &_hurd_intr_rpc_msg_cx_sp
+ && state->basic.eip < (int) &_hurd_intr_rpc_msg_sp_restored)
+ /* The SP now points at the mach_msg args, but there is more stack
+ space used below it. The real SP is saved in %ecx; we must push the
+ new frame below there (if not on the altstack), and restore that value as
+ the SP on sigreturn. */
+ state->basic.uesp = state->basic.ecx;
+
+ if ((ss->actions[signo].sa_flags & SA_ONSTACK)
+ && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK)))
+ {
+ sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size;
+ ss->sigaltstack.ss_flags |= SS_ONSTACK;
+ }
else
sigsp = (char *) state->basic.uesp;
diff --git a/sysdeps/mach/hurd/if_index.c b/sysdeps/mach/hurd/if_index.c
index 4303c938a8..20af77b2b9 100644
--- a/sysdeps/mach/hurd/if_index.c
+++ b/sysdeps/mach/hurd/if_index.c
@@ -1,5 +1,5 @@
/* Find network interface names and index numbers. Hurd version.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <error.h>
#include <net/if.h>
diff --git a/sysdeps/mach/hurd/ifreq.c b/sysdeps/mach/hurd/ifreq.c
index 70a906a83a..191bd62e4b 100644
--- a/sysdeps/mach/hurd/ifreq.c
+++ b/sysdeps/mach/hurd/ifreq.c
@@ -1,5 +1,5 @@
/* Fetch the host's network interface list. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <ifreq.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/ifreq.h b/sysdeps/mach/hurd/ifreq.h
index 3ab8d858b6..c6e42f3bb5 100644
--- a/sysdeps/mach/hurd/ifreq.h
+++ b/sysdeps/mach/hurd/ifreq.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 15b26f5bba..f450f9896e 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/ioctl.h>
@@ -66,15 +66,15 @@ __ioctl (int fd, unsigned long int request, ...)
kern_return_t RetCode;
} header_typecheck;
};
- char data[3 * sizeof (mach_msg_type_t) +
- msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) +
- msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) +
- _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))];
+ char data[3 * sizeof (mach_msg_type_t)
+ + msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)))
+ + msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)))
+ + _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))];
#else /* Untyped Mach IPC format. */
mig_reply_error_t header;
- char data[_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)) +
- _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)) +
- _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))];
+ char data[_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))
+ + _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))
+ + _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))];
mach_msg_trailer_t trailer;
#endif
} msg;
@@ -177,6 +177,7 @@ __ioctl (int fd, unsigned long int request, ...)
case MACH_SEND_INVALID_REPLY:
case MACH_RCV_INVALID_NAME:
__mig_dealloc_reply_port (m->msgh_local_port);
+ /* Fall through. */
default:
return err;
}
@@ -191,17 +192,17 @@ __ioctl (int fd, unsigned long int request, ...)
}
if (m->msgh_id != msgid + 100)
- return (m->msgh_id == MACH_NOTIFY_SEND_ONCE ?
- MIG_SERVER_DIED : MIG_REPLY_MISMATCH);
+ return (m->msgh_id == MACH_NOTIFY_SEND_ONCE
+ ? MIG_SERVER_DIED : MIG_REPLY_MISMATCH);
- if (m->msgh_size != reply_size &&
- m->msgh_size != sizeof msg.header)
+ if (m->msgh_size != reply_size
+ && m->msgh_size != sizeof msg.header)
return MIG_TYPE_ERROR;
#ifdef MACH_MSG_TYPE_BIT
- if (msg.header_typecheck.RetCodeType !=
- ((union { mach_msg_type_t t; int i; })
- { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i)
+ if (msg.header_typecheck.RetCodeType
+ != ((union { mach_msg_type_t t; int i; })
+ { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i)
return MIG_TYPE_ERROR;
#endif
return msg.header.RetCode;
@@ -306,11 +307,11 @@ __ioctl (int fd, unsigned long int request, ...)
}
case 0:
- if (m->msgh_size != reply_size ||
- ((_IOC_INOUT (request) & IOC_OUT) &&
- (out (_IOT_COUNT0 (type), _IOT_TYPE0 (type), arg, &arg) ||
- out (_IOT_COUNT1 (type), _IOT_TYPE1 (type), arg, &arg) ||
- out (_IOT_COUNT2 (type), _IOT_TYPE2 (type), arg, &arg))))
+ if (m->msgh_size != reply_size
+ || ((_IOC_INOUT (request) & IOC_OUT)
+ && (out (_IOT_COUNT0 (type), _IOT_TYPE0 (type), arg, &arg)
+ || out (_IOT_COUNT1 (type), _IOT_TYPE1 (type), arg, &arg)
+ || out (_IOT_COUNT2 (type), _IOT_TYPE2 (type), arg, &arg))))
return __hurd_fail (MIG_TYPE_ERROR);
return 0;
@@ -318,6 +319,7 @@ __ioctl (int fd, unsigned long int request, ...)
case EOPNOTSUPP:
/* The server didn't understand the RPC. */
err = ENOTTY;
+ /* Fall through. */
default:
return __hurd_fail (err);
}
diff --git a/sysdeps/mach/hurd/isatty.c b/sysdeps/mach/hurd/isatty.c
index 4adc8901fb..5c44627557 100644
--- a/sysdeps/mach/hurd/isatty.c
+++ b/sysdeps/mach/hurd/isatty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/jmp-unwind.c b/sysdeps/mach/hurd/jmp-unwind.c
index d269f9f61b..0bc1c49af5 100644
--- a/sysdeps/mach/hurd/jmp-unwind.c
+++ b/sysdeps/mach/hurd/jmp-unwind.c
@@ -1,5 +1,5 @@
/* _longjmp_unwind -- Clean up stack frames unwound by longjmp. Hurd version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <jmpbuf-unwind.h>
#include <hurd/userlink.h>
@@ -54,8 +54,8 @@ _longjmp_unwind (jmp_buf env, int val)
__spin_lock (&ss->critical_section_lock);
/* Remove local signal preemptors being unwound past. */
- while (ss->preemptors &&
- _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors, demangle_ptr))
+ while (ss->preemptors
+ && _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors, demangle_ptr))
ss->preemptors = ss->preemptors->next;
__spin_unlock (&ss->lock);
diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
index a13d6cdf11..adec16e52c 100644
--- a/sysdeps/mach/hurd/kernel-features.h
+++ b/sysdeps/mach/hurd/kernel-features.h
@@ -1,5 +1,5 @@
/* Set flags signalling availability of certain operating system features.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* This file can define __ASSUME_* macros checked by certain source files.
Almost none of these are used outside of sysdeps/unix/sysv/linux code.
diff --git a/sysdeps/mach/hurd/kill.c b/sysdeps/mach/hurd/kill.c
index 7e64e7c9d7..c7406ab8ba 100644
--- a/sysdeps/mach/hurd/kill.c
+++ b/sysdeps/mach/hurd/kill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
@@ -55,8 +55,8 @@ __kill (pid_t pid, int sig)
err = __task_terminate (refport);
__mach_port_deallocate (__mach_task_self (), refport);
}
- } while (err == MACH_SEND_INVALID_DEST ||
- err == MIG_SERVER_DIED);
+ } while (err == MACH_SEND_INVALID_DEST
+ || err == MIG_SERVER_DIED);
else
{
error_t taskerr;
@@ -103,8 +103,8 @@ __kill (pid_t pid, int sig)
}
err = HURD_MSGPORT_RPC (__proc_getmsgport (proc, pid, &msgport),
(taskerr = __proc_pid2task (proc, pid,
- &refport)) ?
- __proc_getsidport (proc, &refport) : 0, 1,
+ &refport))
+ ? __proc_getsidport (proc, &refport) : 0, 1,
kill_port (msgport, refport));
}
if (! err)
diff --git a/sysdeps/mach/hurd/lchmod.c b/sysdeps/mach/hurd/lchmod.c
index 0fd02e86b8..3b48c2820f 100644
--- a/sysdeps/mach/hurd/lchmod.c
+++ b/sysdeps/mach/hurd/lchmod.c
@@ -1,5 +1,5 @@
/* lchmod -- Change the protections of a file or symbolic link. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/lchown.c b/sysdeps/mach/hurd/lchown.c
index eb5760eb18..4ebcb837ba 100644
--- a/sysdeps/mach/hurd/lchown.c
+++ b/sysdeps/mach/hurd/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/lgetxattr.c b/sysdeps/mach/hurd/lgetxattr.c
index ae385f8379..c93ab6b886 100644
--- a/sysdeps/mach/hurd/lgetxattr.c
+++ b/sysdeps/mach/hurd/lgetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/libc-start.h b/sysdeps/mach/hurd/libc-start.h
index f7e39935ce..8e52898a12 100644
--- a/sysdeps/mach/hurd/libc-start.h
+++ b/sysdeps/mach/hurd/libc-start.h
@@ -1,5 +1,5 @@
/* Hurd definitions for libc main startup.
- Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ Copyright (C) 2017-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _LIBC_START_H
#define _LIBC_START_H
diff --git a/sysdeps/mach/hurd/link.c b/sysdeps/mach/hurd/link.c
index f50d63cb1a..9d34d2359d 100644
--- a/sysdeps/mach/hurd/link.c
+++ b/sysdeps/mach/hurd/link.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/linkat.c b/sysdeps/mach/hurd/linkat.c
index e2e427cb4d..acf28cf3ea 100644
--- a/sysdeps/mach/hurd/linkat.c
+++ b/sysdeps/mach/hurd/linkat.c
@@ -1,5 +1,5 @@
/* Make a link between file names relative to open directories. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/listen.c b/sysdeps/mach/hurd/listen.c
index 2b2cf23eb6..74cd1d40e9 100644
--- a/sysdeps/mach/hurd/listen.c
+++ b/sysdeps/mach/hurd/listen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/listxattr.c b/sysdeps/mach/hurd/listxattr.c
index c1af8072c1..60715475ca 100644
--- a/sysdeps/mach/hurd/listxattr.c
+++ b/sysdeps/mach/hurd/listxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/llistxattr.c b/sysdeps/mach/hurd/llistxattr.c
index 0b3e848c7d..4b3d726395 100644
--- a/sysdeps/mach/hurd/llistxattr.c
+++ b/sysdeps/mach/hurd/llistxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/lremovexattr.c b/sysdeps/mach/hurd/lremovexattr.c
index a6fa830d4a..101af3559e 100644
--- a/sysdeps/mach/hurd/lremovexattr.c
+++ b/sysdeps/mach/hurd/lremovexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/lseek.c b/sysdeps/mach/hurd/lseek.c
index 0a4077268a..d21ff678b0 100644
--- a/sysdeps/mach/hurd/lseek.c
+++ b/sysdeps/mach/hurd/lseek.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/lseek64.c b/sysdeps/mach/hurd/lseek64.c
index d058ab36ff..00232fc57a 100644
--- a/sysdeps/mach/hurd/lseek64.c
+++ b/sysdeps/mach/hurd/lseek64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/lsetxattr.c b/sysdeps/mach/hurd/lsetxattr.c
index 95a2899a09..5dfc953c69 100644
--- a/sysdeps/mach/hurd/lsetxattr.c
+++ b/sysdeps/mach/hurd/lsetxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2004-2018 Free Software Foundation, Inc.
+ Copyright (C) 2004-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/lutimes.c b/sysdeps/mach/hurd/lutimes.c
index 375ab3feb3..183e6a2de0 100644
--- a/sysdeps/mach/hurd/lutimes.c
+++ b/sysdeps/mach/hurd/lutimes.c
@@ -1,5 +1,5 @@
/* lutimes -- change access and modification times of a symlink. Hurd version.
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/lxstat.c b/sysdeps/mach/hurd/lxstat.c
index ea69f78b2b..4f27f9c0a4 100644
--- a/sysdeps/mach/hurd/lxstat.c
+++ b/sysdeps/mach/hurd/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/stat.h>
diff --git a/sysdeps/mach/hurd/lxstat64.c b/sysdeps/mach/hurd/lxstat64.c
index e060d2c1f6..45d0313693 100644
--- a/sysdeps/mach/hurd/lxstat64.c
+++ b/sysdeps/mach/hurd/lxstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/malloc-machine.h b/sysdeps/mach/hurd/malloc-machine.h
index 36a7d11dc5..7f9e4b980b 100644
--- a/sysdeps/mach/hurd/malloc-machine.h
+++ b/sysdeps/mach/hurd/malloc-machine.h
@@ -1,6 +1,6 @@
/* Basic platform-independent macro definitions for mutexes,
thread-specific data and parameters for malloc.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _MALLOC_MACHINE_H
#define _MALLOC_MACHINE_H
diff --git a/sysdeps/mach/hurd/mig-reply.c b/sysdeps/mach/hurd/mig-reply.c
index 8350354500..3ff0d1a136 100644
--- a/sysdeps/mach/hurd/mig-reply.c
+++ b/sysdeps/mach/hurd/mig-reply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <mach.h>
#include <mach/mig_support.h>
@@ -27,9 +27,9 @@ mach_port_t __hurd_reply_port0;
mach_port_t
__mig_get_reply_port (void)
{
- if (__hurd_local_reply_port == MACH_PORT_NULL ||
- (&__hurd_local_reply_port != &__hurd_reply_port0
- && __hurd_local_reply_port == __hurd_reply_port0))
+ if (__hurd_local_reply_port == MACH_PORT_NULL
+ || (&__hurd_local_reply_port != &__hurd_reply_port0
+ && __hurd_local_reply_port == __hurd_reply_port0))
__hurd_local_reply_port = __mach_reply_port ();
return __hurd_local_reply_port;
diff --git a/sysdeps/mach/hurd/mkdir.c b/sysdeps/mach/hurd/mkdir.c
index fa01aabde0..8bf9b59cfd 100644
--- a/sysdeps/mach/hurd/mkdir.c
+++ b/sysdeps/mach/hurd/mkdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/mkdirat.c b/sysdeps/mach/hurd/mkdirat.c
index f214e08cab..da7c3e80c1 100644
--- a/sysdeps/mach/hurd/mkdirat.c
+++ b/sysdeps/mach/hurd/mkdirat.c
@@ -1,5 +1,5 @@
/* Create a directory named relative to another open directory. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/mlock.c b/sysdeps/mach/hurd/mlock.c
index 28a33be24f..1ed54e2602 100644
--- a/sysdeps/mach/hurd/mlock.c
+++ b/sysdeps/mach/hurd/mlock.c
@@ -1,5 +1,5 @@
/* mlock -- guarantee pages are resident in memory. Mach/Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/mlockall.c b/sysdeps/mach/hurd/mlockall.c
index 6fa944b21f..09c828b676 100644
--- a/sysdeps/mach/hurd/mlockall.c
+++ b/sysdeps/mach/hurd/mlockall.c
@@ -1,5 +1,5 @@
/* mlockall -- lock in core all the pages in this process. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index e388ac9783..1e6ab401af 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/mman.h>
@@ -44,29 +44,6 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1)))
return (void *) (long int) __hurd_fail (EINVAL);
- if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON
- && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
- {
- /* vm_allocate has (a little) less overhead in the kernel too. */
- err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0);
-
- if (err == KERN_NO_SPACE)
- {
- if (flags & MAP_FIXED)
- {
- /* XXX this is not atomic as it is in unix! */
- /* The region is already allocated; deallocate it first. */
- err = __vm_deallocate (__mach_task_self (), mapaddr, len);
- if (!err)
- err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0);
- }
- else if (mapaddr != 0)
- err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1);
- }
-
- return err ? (void *) (long int) __hurd_fail (err) : (void *) mapaddr;
- }
-
vmprot = VM_PROT_NONE;
if (prot & PROT_READ)
vmprot |= VM_PROT_READ;
@@ -120,8 +97,8 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
/* Remove extra reference. */
__mach_port_deallocate (__mach_task_self (), memobj);
}
- else if (wobj == MACH_PORT_NULL && /* Not writable by mapping. */
- !(flags & MAP_SHARED))
+ else if (wobj == MACH_PORT_NULL /* Not writable by mapping. */
+ && !(flags & MAP_SHARED))
/* The file can only be mapped for reading. Since we are
making a private mapping, we will never try to write the
object anyway, so we don't care. */
diff --git a/sysdeps/mach/hurd/mmap64.c b/sysdeps/mach/hurd/mmap64.c
index 19133ceca5..0a4ecf1291 100644
--- a/sysdeps/mach/hurd/mmap64.c
+++ b/sysdeps/mach/hurd/mmap64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/msync.c b/sysdeps/mach/hurd/msync.c
new file mode 100644
index 0000000000..b5adc5517e
--- /dev/null
+++ b/sysdeps/mach/hurd/msync.c
@@ -0,0 +1,93 @@
+/* msync -- Synchronize mapped memory to external storage. Mach version.
+ Copyright (C) 2002-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+#include <hurd/hurd.h>
+
+/* Synchronize the region starting at ADDR and extending LEN bytes with the
+ file it maps. Filesystem operations on a file being mapped are
+ unpredictable before this is done. */
+
+int
+msync (void *addr, size_t length, int flags)
+{
+ boolean_t should_flush = flags & MS_INVALIDATE ? 1 : 0;
+ boolean_t should_iosync = flags & MS_ASYNC ? 0 : 1;
+
+ vm_address_t cur = (vm_address_t) addr;
+ vm_address_t target = cur + length;
+
+ vm_size_t len;
+ vm_prot_t prot;
+ vm_prot_t max_prot;
+ vm_inherit_t inherit;
+ boolean_t shared;
+ memory_object_name_t obj;
+ vm_offset_t offset;
+
+ kern_return_t err;
+
+ if (flags & (MS_SYNC | MS_ASYNC) == (MS_SYNC | MS_ASYNC))
+ return __hurd_fail (EINVAL);
+
+ while (cur < target)
+ {
+ vm_address_t begin = cur;
+
+ err = __vm_region (__mach_task_self (),
+ &begin, &len, &prot, &max_prot, &inherit,
+ &shared, &obj, &offset);
+
+ if (err != KERN_SUCCESS)
+ return __hurd_fail (err);
+
+ if (begin > cur)
+ /* We were given an address before the first region,
+ or we found a hole. */
+ cur = begin;
+
+ if (cur >= target)
+ /* We were given an ending address within a hole. */
+ break;
+
+ if (MACH_PORT_VALID (obj))
+ {
+ vm_size_t sync_len;
+
+ if (begin + len > target)
+ sync_len = target - begin;
+ else
+ sync_len = len;
+
+ err = __vm_object_sync (obj, cur - begin + offset, sync_len,
+ should_flush, 1, should_iosync);
+ __mach_port_deallocate (__mach_task_self (), obj);
+
+ if (err)
+ return __hurd_fail (err);
+
+ }
+
+ cur = begin + len;
+ }
+
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/munlock.c b/sysdeps/mach/hurd/munlock.c
index 3ef4dbb175..a823ccd895 100644
--- a/sysdeps/mach/hurd/munlock.c
+++ b/sysdeps/mach/hurd/munlock.c
@@ -1,5 +1,5 @@
/* munlock -- undo the effects of prior mlock calls. Mach/Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/munlockall.c b/sysdeps/mach/hurd/munlockall.c
index 615b77f034..bbd74c3337 100644
--- a/sysdeps/mach/hurd/munlockall.c
+++ b/sysdeps/mach/hurd/munlockall.c
@@ -1,5 +1,5 @@
/* munlockall -- undo the effects of all prior mlock calls. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/mman.h>
diff --git a/sysdeps/mach/hurd/net/ethernet.h b/sysdeps/mach/hurd/net/ethernet.h
index 31f15cbe0f..46fe503859 100644
--- a/sysdeps/mach/hurd/net/ethernet.h
+++ b/sysdeps/mach/hurd/net/ethernet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Based on the FreeBSD version of this file. Curiously, that file
lacks a copyright in the header. */
diff --git a/sysdeps/mach/hurd/net/if_arp.h b/sysdeps/mach/hurd/net/if_arp.h
index 01c8b62a99..bd5b3c3b10 100644
--- a/sysdeps/mach/hurd/net/if_arp.h
+++ b/sysdeps/mach/hurd/net/if_arp.h
@@ -1,5 +1,5 @@
/* Definitions for Address Resolution Protocol.
- Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ Copyright (C) 1997-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Based on the 4.4BSD and Linux version of this file. */
diff --git a/sysdeps/mach/hurd/net/if_ether.h b/sysdeps/mach/hurd/net/if_ether.h
index d499b1d6ed..5f19d4853f 100644
--- a/sysdeps/mach/hurd/net/if_ether.h
+++ b/sysdeps/mach/hurd/net/if_ether.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _NET_IF_ETHER_H
#define _NET_IF_ETHER_H 1
diff --git a/sysdeps/mach/hurd/net/route.h b/sysdeps/mach/hurd/net/route.h
index c47944316f..c10ffe16d0 100644
--- a/sysdeps/mach/hurd/net/route.h
+++ b/sysdeps/mach/hurd/net/route.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2018 Free Software Foundation, Inc..
+/* Copyright (C) 1997-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* Based on the 4.4BSD and Linux version of this file. */
diff --git a/sysdeps/mach/hurd/not-cancel.h b/sysdeps/mach/hurd/not-cancel.h
new file mode 100644
index 0000000000..c9a67c199d
--- /dev/null
+++ b/sysdeps/mach/hurd/not-cancel.h
@@ -0,0 +1,62 @@
+/* Uncancelable versions of cancelable interfaces. Hurd version.
+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+ 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef NOT_CANCEL_H
+# define NOT_CANCEL_H
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <sys/uio.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+/* For now we have none. Map the name to the normal functions. */
+#define __open_nocancel(...) \
+ __open (__VA_ARGS__)
+#define __open64_nocancel(...) \
+ __open64 (__VA_ARGS__)
+#define __openat_nocancel(...) \
+ __openat (__VA_ARGS__)
+#define __openat64_nocancel(...) \
+ __openat64 (__VA_ARGS__)
+#define __close_nocancel(fd) \
+ __close (fd)
+
+void __close_nocancel_nostatus (int fd);
+
+#define __read_nocancel(fd, buf, n) \
+ __read (fd, buf, n)
+#define __pread64_nocancel(fd, buf, count, offset) \
+ __pread64 (fd, buf, count, offset)
+#define __write_nocancel(fd, buf, n) \
+ __write (fd, buf, n)
+#define __writev_nocancel_nostatus(fd, iov, n) \
+ (void) __writev (fd, iov, n)
+# define __waitpid_nocancel(pid, stat_loc, options) \
+ __waitpid (pid, stat_loc, options)
+#define __fcntl64_nocancel(fd, cmd, ...) \
+ __fcntl64 (fd, cmd, __VA_ARGS__)
+
+#if IS_IN (libc) || IS_IN (rtld)
+hidden_proto (__close_nocancel_nostatus)
+#endif
+
+#endif /* NOT_CANCEL_H */
diff --git a/sysdeps/mach/hurd/not-errno.h b/sysdeps/mach/hurd/not-errno.h
index 838a5abc69..eeb519ce8c 100644
--- a/sysdeps/mach/hurd/not-errno.h
+++ b/sysdeps/mach/hurd/not-errno.h
@@ -1,5 +1,5 @@
/* Syscall wrapper that do not set errno. Generic version.
- Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ Copyright (C) 2017-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* The __access_noerrno stub mustn't be hidden in ld.so on Hurd since it needs
to be preempted by __access_noerrno from libc.so after bootstrap. */
diff --git a/sysdeps/mach/hurd/open.c b/sysdeps/mach/hurd/open.c
index 8acdd3d418..0e43db7fd0 100644
--- a/sysdeps/mach/hurd/open.c
+++ b/sysdeps/mach/hurd/open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c
index 3534f256bc..790a5a0124 100644
--- a/sysdeps/mach/hurd/openat.c
+++ b/sysdeps/mach/hurd/openat.c
@@ -1,5 +1,5 @@
/* openat -- Open a file named relative to an open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index bda138e439..1f04c197ec 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <limits.h>
diff --git a/sysdeps/mach/hurd/pathconf.c b/sysdeps/mach/hurd/pathconf.c
index 62099a6c05..db4049e7f7 100644
--- a/sysdeps/mach/hurd/pathconf.c
+++ b/sysdeps/mach/hurd/pathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/pipe.c b/sysdeps/mach/hurd/pipe.c
index 9e67ef7c84..ae5ed128fd 100644
--- a/sysdeps/mach/hurd/pipe.c
+++ b/sysdeps/mach/hurd/pipe.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/pipe2.c b/sysdeps/mach/hurd/pipe2.c
index 288d4b8c67..506686300a 100644
--- a/sysdeps/mach/hurd/pipe2.c
+++ b/sysdeps/mach/hurd/pipe2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/poll.c b/sysdeps/mach/hurd/poll.c
index 50d0ad7290..efde0478ea 100644
--- a/sysdeps/mach/hurd/poll.c
+++ b/sysdeps/mach/hurd/poll.c
@@ -1,5 +1,5 @@
/* poll file descriptors. Hurd version.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/poll.h>
#include <sys/time.h>
diff --git a/sysdeps/mach/hurd/ppoll.c b/sysdeps/mach/hurd/ppoll.c
index 615fc0814c..98b06c7f51 100644
--- a/sysdeps/mach/hurd/ppoll.c
+++ b/sysdeps/mach/hurd/ppoll.c
@@ -1,5 +1,5 @@
/* poll file descriptors. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/poll.h>
#include <sys/time.h>
diff --git a/sysdeps/mach/hurd/pread.c b/sysdeps/mach/hurd/pread.c
index 63a90aa4df..bd83d8d0a2 100644
--- a/sysdeps/mach/hurd/pread.c
+++ b/sysdeps/mach/hurd/pread.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
Hurd version.
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/pread64.c b/sysdeps/mach/hurd/pread64.c
index 1a6ec06acd..84c61336fb 100644
--- a/sysdeps/mach/hurd/pread64.c
+++ b/sysdeps/mach/hurd/pread64.c
@@ -1,6 +1,6 @@
/* Read block from given position in file without changing file pointer.
Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/profil.c b/sysdeps/mach/hurd/profil.c
index c2c2f9f119..54ab498656 100644
--- a/sysdeps/mach/hurd/profil.c
+++ b/sysdeps/mach/hurd/profil.c
@@ -1,5 +1,5 @@
/* Low-level statistical profiling support function. Mach/Hurd version.
- Copyright (C) 1995-2018 Free Software Foundation, Inc.
+ Copyright (C) 1995-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/pselect.c b/sysdeps/mach/hurd/pselect.c
index 1d469c025a..25e5799e9e 100644
--- a/sysdeps/mach/hurd/pselect.c
+++ b/sysdeps/mach/hurd/pselect.c
@@ -1,5 +1,5 @@
/* pselect for Hurd.
- Copyright (C) 1998-2018 Free Software Foundation, Inc.
+ Copyright (C) 1998-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <signal.h>
diff --git a/sysdeps/mach/hurd/ptrace.c b/sysdeps/mach/hurd/ptrace.c
index d0268a3f98..17baf6375d 100644
--- a/sysdeps/mach/hurd/ptrace.c
+++ b/sysdeps/mach/hurd/ptrace.c
@@ -1,5 +1,5 @@
/* Process tracing interface `ptrace' for GNU Hurd.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/ptrace.h>
@@ -178,8 +178,8 @@ ptrace (enum __ptrace_request request, ... )
if (! err)
{
err = __msg_set_init_int (msgport, task, INIT_TRACEMASK,
- request == PTRACE_DETACH ? 0 :
- ~(sigset_t) 0);
+ request == PTRACE_DETACH ? 0
+ : ~(sigset_t) 0);
if (! err)
{
if (request == PTRACE_ATTACH)
@@ -349,8 +349,8 @@ ptrace (enum __ptrace_request request, ... )
task_t task = __pid2task (pid);
if (task == MACH_PORT_NULL)
return -1;
- if ((vm_address_t) addr % __vm_page_size == 0 &&
- (vm_address_t) data % __vm_page_size == 0)
+ if ((vm_address_t) addr % __vm_page_size == 0
+ && (vm_address_t) data % __vm_page_size == 0)
{
/* Writing whole pages; can go directly from the user's buffer. */
ourpage = (vm_address_t) addr2;
diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c
index 5c1dc6e981..310c8b83a2 100644
--- a/sysdeps/mach/hurd/ptsname.c
+++ b/sysdeps/mach/hurd/ptsname.c
@@ -1,5 +1,5 @@
/* ptsname -- return the name of a pty slave given an FD to the pty master
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/pwrite.c b/sysdeps/mach/hurd/pwrite.c
index 80be158489..446e0e274d 100644
--- a/sysdeps/mach/hurd/pwrite.c
+++ b/sysdeps/mach/hurd/pwrite.c
@@ -1,6 +1,6 @@
/* Write block at given position in file without changing file pointer.
Hurd version.
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/pwrite64.c b/sysdeps/mach/hurd/pwrite64.c
index bfa6b02c14..492dc09a89 100644
--- a/sysdeps/mach/hurd/pwrite64.c
+++ b/sysdeps/mach/hurd/pwrite64.c
@@ -1,6 +1,6 @@
/* Write block to given position in file without changing file pointer.
Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/read.c b/sysdeps/mach/hurd/read.c
index 20a4b979f6..edbbbb6ca9 100644
--- a/sysdeps/mach/hurd/read.c
+++ b/sysdeps/mach/hurd/read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/readdir.c b/sysdeps/mach/hurd/readdir.c
index 16f608cf5a..99fa069ab0 100644
--- a/sysdeps/mach/hurd/readdir.c
+++ b/sysdeps/mach/hurd/readdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/readdir64.c b/sysdeps/mach/hurd/readdir64.c
index f28d8603ab..a3d168ebbc 100644
--- a/sysdeps/mach/hurd/readdir64.c
+++ b/sysdeps/mach/hurd/readdir64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <dirent.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/readdir64_r.c b/sysdeps/mach/hurd/readdir64_r.c
index eb39833c71..60f81475b8 100644
--- a/sysdeps/mach/hurd/readdir64_r.c
+++ b/sysdeps/mach/hurd/readdir64_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <dirent.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/readdir_r.c b/sysdeps/mach/hurd/readdir_r.c
index 4b34434170..a357820acc 100644
--- a/sysdeps/mach/hurd/readdir_r.c
+++ b/sysdeps/mach/hurd/readdir_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <limits.h>
diff --git a/sysdeps/mach/hurd/readlink.c b/sysdeps/mach/hurd/readlink.c
index e1368d8fd0..768cb2e4b3 100644
--- a/sysdeps/mach/hurd/readlink.c
+++ b/sysdeps/mach/hurd/readlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/readlinkat.c b/sysdeps/mach/hurd/readlinkat.c
index e601c6b619..267e0b3801 100644
--- a/sysdeps/mach/hurd/readlinkat.c
+++ b/sysdeps/mach/hurd/readlinkat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/reboot.c b/sysdeps/mach/hurd/reboot.c
index beeb9bfcbc..76436cac8d 100644
--- a/sysdeps/mach/hurd/reboot.c
+++ b/sysdeps/mach/hurd/reboot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c
index 0bc5ce4bfc..ac87cf9ef1 100644
--- a/sysdeps/mach/hurd/recv.c
+++ b/sysdeps/mach/hurd/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c
index 5d71a21b98..166c7bbd4d 100644
--- a/sysdeps/mach/hurd/recvfrom.c
+++ b/sysdeps/mach/hurd/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index 770ca7187b..bb8d8305ea 100644
--- a/sysdeps/mach/hurd/recvmsg.c
+++ b/sysdeps/mach/hurd/recvmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/removexattr.c b/sysdeps/mach/hurd/removexattr.c
index 6fdb88c3e9..c2cccfb771 100644
--- a/sysdeps/mach/hurd/removexattr.c
+++ b/sysdeps/mach/hurd/removexattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2005-2018 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/rename.c b/sysdeps/mach/hurd/rename.c
index ea3ffa3792..1d1d9b5f6d 100644
--- a/sysdeps/mach/hurd/rename.c
+++ b/sysdeps/mach/hurd/rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/renameat.c b/sysdeps/mach/hurd/renameat.c
index 7985763f73..e429a23f47 100644
--- a/sysdeps/mach/hurd/renameat.c
+++ b/sysdeps/mach/hurd/renameat.c
@@ -1,5 +1,5 @@
/* Rename a file using relative source and destination names. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <hurd.h>
@@ -24,26 +24,7 @@
int
__renameat (int oldfd, const char *old, int newfd, const char *new)
{
- error_t err;
- file_t olddir, newdir;
- const char *oldname, *newname;
-
- olddir = __directory_name_split_at (oldfd, old, (char **) &oldname);
- if (olddir == MACH_PORT_NULL)
- return -1;
- newdir = __directory_name_split_at (newfd, new, (char **) &newname);
- if (newdir == MACH_PORT_NULL)
- {
- __mach_port_deallocate (__mach_task_self (), olddir);
- return -1;
- }
-
- err = __dir_rename (olddir, oldname, newdir, newname, 0);
- __mach_port_deallocate (__mach_task_self (), olddir);
- __mach_port_deallocate (__mach_task_self (), newdir);
- if (err)
- return __hurd_fail (err);
- return 0;
+ return __renameat2 (oldfd, old, newfd, new, 0);
}
libc_hidden_def (__renameat)
weak_alias (__renameat, renameat)
diff --git a/sysdeps/mach/hurd/renameat2.c b/sysdeps/mach/hurd/renameat2.c
new file mode 100644
index 0000000000..9e8f39d540
--- /dev/null
+++ b/sysdeps/mach/hurd/renameat2.c
@@ -0,0 +1,58 @@
+/* Rename a file using relative source and destination names. Hurd version.
+ Copyright (C) 1991-2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */
+int
+__renameat2 (int oldfd, const char *old, int newfd, const char *new,
+ unsigned int flags)
+{
+ error_t err;
+ file_t olddir, newdir;
+ const char *oldname, *newname;
+ int excl = 0;
+
+ if ((flags & (RENAME_EXCHANGE | RENAME_NOREPLACE)) == (RENAME_EXCHANGE | RENAME_NOREPLACE))
+ return __hurd_fail (EINVAL);
+ if (flags & (RENAME_EXCHANGE | RENAME_WHITEOUT))
+ return __hurd_fail (ENOSYS);
+ if (flags & RENAME_NOREPLACE)
+ excl = 1;
+
+ olddir = __directory_name_split_at (oldfd, old, (char **) &oldname);
+ if (olddir == MACH_PORT_NULL)
+ return -1;
+ newdir = __directory_name_split_at (newfd, new, (char **) &newname);
+ if (newdir == MACH_PORT_NULL)
+ {
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ return -1;
+ }
+
+ err = __dir_rename (olddir, oldname, newdir, newname, excl);
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ __mach_port_deallocate (__mach_task_self (), newdir);
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
+libc_hidden_def (__renameat2)
+weak_alias (__renameat2, renameat2)
diff --git a/sysdeps/mach/hurd/res_enable_icmp.c b/sysdeps/mach/hurd/res_enable_icmp.c
new file mode 100644
index 0000000000..d613158e8f
--- /dev/null
+++ b/sysdeps/mach/hurd/res_enable_icmp.c
@@ -0,0 +1,27 @@
+/* Enable full ICMP errors on a socket. No-op version for Hurd.
+ Copyright (C) 2019 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, see
+ <https://www.gnu.org/licenses/>. */
+
+/* Mach does not support the IP_RECVERR extension. */
+
+#include <resolv.h>
+
+int
+__res_enable_icmp (int family, int fd)
+{
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/revoke.c b/sysdeps/mach/hurd/revoke.c
index 5b1495a238..d9258304d5 100644
--- a/sysdeps/mach/hurd/revoke.c
+++ b/sysdeps/mach/hurd/revoke.c
@@ -1,5 +1,5 @@
/* Revoke the access of all descriptors currently open on a file. Hurd version
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/rewinddir.c b/sysdeps/mach/hurd/rewinddir.c
index 4e8864f9ea..1f4a043f1d 100644
--- a/sysdeps/mach/hurd/rewinddir.c
+++ b/sysdeps/mach/hurd/rewinddir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <dirent.h>
diff --git a/sysdeps/mach/hurd/rmdir.c b/sysdeps/mach/hurd/rmdir.c
index 1ad10fbb68..a3b5f9c6ed 100644
--- a/sysdeps/mach/hurd/rmdir.c
+++ b/sysdeps/mach/hurd/rmdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/sbrk.c b/sysdeps/mach/hurd/sbrk.c
index 2736342734..ac01d3366f 100644
--- a/sysdeps/mach/hurd/sbrk.c
+++ b/sysdeps/mach/hurd/sbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c
index a7b9222452..04c6873f42 100644
--- a/sysdeps/mach/hurd/seekdir.c
+++ b/sysdeps/mach/hurd/seekdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/select.c b/sysdeps/mach/hurd/select.c
index bcf8fbf8f7..4ae453840b 100644
--- a/sysdeps/mach/hurd/select.c
+++ b/sysdeps/mach/hurd/select.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/time.h>
diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c
index c7dc907129..1df9d7285d 100644
--- a/sysdeps/mach/hurd/send.c
+++ b/sysdeps/mach/hurd/send.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/sendfile.c b/sysdeps/mach/hurd/sendfile.c
index 4df66b56d7..3456cbd7a8 100644
--- a/sysdeps/mach/hurd/sendfile.c
+++ b/sysdeps/mach/hurd/sendfile.c
@@ -1,5 +1,5 @@
/* sendfile -- copy data directly from one file descriptor to another
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/sendfile.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/sendfile64.c b/sysdeps/mach/hurd/sendfile64.c
index ea4e96da90..44c7ca9ffc 100644
--- a/sysdeps/mach/hurd/sendfile64.c
+++ b/sysdeps/mach/hurd/sendfile64.c
@@ -1,5 +1,5 @@
/* sendfile -- copy data directly from one file descriptor to another
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/sendfile.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index d12f4a1e90..af1b9d17a3 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/sendto.c b/sysdeps/mach/hurd/sendto.c
index 46cabbb9cf..73368f3805 100644
--- a/sysdeps/mach/hurd/sendto.c
+++ b/sysdeps/mach/hurd/sendto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/setdomain.c b/sysdeps/mach/hurd/setdomain.c
index f78e8626c1..ed9ddc19b4 100644
--- a/sysdeps/mach/hurd/setdomain.c
+++ b/sysdeps/mach/hurd/setdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include "hurdhost.h"
diff --git a/sysdeps/mach/hurd/setegid.c b/sysdeps/mach/hurd/setegid.c
index c5e8cf622f..ef7233d2fa 100644
--- a/sysdeps/mach/hurd/setegid.c
+++ b/sysdeps/mach/hurd/setegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/seteuid.c b/sysdeps/mach/hurd/seteuid.c
index d6001960a8..0ea98df484 100644
--- a/sysdeps/mach/hurd/seteuid.c
+++ b/sysdeps/mach/hurd/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setgid.c b/sysdeps/mach/hurd/setgid.c
index faac055f71..98120bc6be 100644
--- a/sysdeps/mach/hurd/setgid.c
+++ b/sysdeps/mach/hurd/setgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setgroups.c b/sysdeps/mach/hurd/setgroups.c
index cdfa869fc2..4633599435 100644
--- a/sysdeps/mach/hurd/setgroups.c
+++ b/sysdeps/mach/hurd/setgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/sethostid.c b/sysdeps/mach/hurd/sethostid.c
index 90c816884b..e305c81dd7 100644
--- a/sysdeps/mach/hurd/sethostid.c
+++ b/sysdeps/mach/hurd/sethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/sethostname.c b/sysdeps/mach/hurd/sethostname.c
index 2771afc2f6..7dce2de40d 100644
--- a/sysdeps/mach/hurd/sethostname.c
+++ b/sysdeps/mach/hurd/sethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include "hurdhost.h"
diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
index f5dfb7da84..2aab365c31 100644
--- a/sysdeps/mach/hurd/setitimer.c
+++ b/sysdeps/mach/hurd/setitimer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <errno.h>
@@ -23,6 +23,7 @@
#include <hurd/signal.h>
#include <hurd/sigpreempt.h>
#include <hurd/msg_request.h>
+#include <mach.h>
#include <mach/message.h>
/* XXX Temporary cheezoid implementation of ITIMER_REAL/SIGALRM. */
@@ -89,8 +90,8 @@ timer_thread (void)
err = __mach_msg (&msg.header,
MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT,
0, 0, _hurd_itimer_port,
- _hurd_itimerval.it_value.tv_sec * 1000 +
- _hurd_itimerval.it_value.tv_usec / 1000,
+ _hurd_itimerval.it_value.tv_sec * 1000
+ + _hurd_itimerval.it_value.tv_usec / 1000,
MACH_PORT_NULL);
switch (err)
{
@@ -128,7 +129,8 @@ timer_thread (void)
/* Forward declaration. */
static int setitimer_locked (const struct itimerval *new,
- struct itimerval *old, void *crit);
+ struct itimerval *old, void *crit,
+ int hurd_siglocked);
static sighandler_t
restart_itimer (struct hurd_signal_preemptor *preemptor,
@@ -142,7 +144,7 @@ restart_itimer (struct hurd_signal_preemptor *preemptor,
/* Either reload or disable the itimer. */
__spin_lock (&_hurd_itimer_lock);
it.it_value = it.it_interval = _hurd_itimerval.it_interval;
- setitimer_locked (&it, NULL, NULL);
+ setitimer_locked (&it, NULL, NULL, 1);
/* Continue with normal delivery (or hold, etc.) of SIGALRM. */
return SIG_ERR;
@@ -154,7 +156,7 @@ restart_itimer (struct hurd_signal_preemptor *preemptor,
static int
setitimer_locked (const struct itimerval *new, struct itimerval *old,
- void *crit)
+ void *crit, int hurd_siglocked)
{
struct itimerval newval;
struct timeval now, remaining, elapsed;
@@ -192,16 +194,19 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
run `restart_itimer' each time a SIGALRM would arrive. */
static struct hurd_signal_preemptor preemptor =
{
- __sigmask (SIGALRM), 0, 0,
+ __sigmask (SIGALRM), SI_TIMER, SI_TIMER,
&restart_itimer,
};
- __mutex_lock (&_hurd_siglock);
+ if (!hurd_siglocked)
+ __mutex_lock (&_hurd_siglock);
if (! preemptor.next && _hurdsig_preemptors != &preemptor)
{
preemptor.next = _hurdsig_preemptors;
_hurdsig_preemptors = &preemptor;
+ _hurdsig_preempted_set |= preemptor.signals;
}
- __mutex_unlock (&_hurd_siglock);
+ if (!hurd_siglocked)
+ __mutex_unlock (&_hurd_siglock);
if (_hurd_itimer_port == MACH_PORT_NULL)
{
@@ -239,12 +244,12 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
if ((newval.it_value.tv_sec | newval.it_value.tv_usec) != 0 || old != NULL)
{
/* Calculate how much time is remaining for the pending alarm. */
- if (__gettimeofday (&now, NULL) < 0)
- {
- __spin_unlock (&_hurd_itimer_lock);
- _hurd_critical_section_unlock (crit);
- return -1;
- }
+ {
+ time_value_t tv;
+ __host_get_time (__mach_host_self (), &tv);
+ now.tv_sec = tv.seconds;
+ now.tv_usec = tv.microseconds;
+ }
elapsed = now;
subtract_timeval (&elapsed, &_hurd_itimer_started);
remaining = _hurd_itimerval.it_value;
@@ -278,8 +283,8 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
kernel context so that when the thread is resumed, mach_msg
will return to timer_thread (below) and it will fetch new
values from _hurd_itimerval. */
- if ((err = __thread_suspend (_hurd_itimer_thread)) ||
- (err = __thread_abort (_hurd_itimer_thread)))
+ if ((err = __thread_suspend (_hurd_itimer_thread))
+ || (err = __thread_abort (_hurd_itimer_thread)))
/* If we can't save it for later, nuke it. */
kill_itimer_thread ();
else
@@ -287,8 +292,8 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
}
}
/* See if the timeout changed. If so, we must alert the itimer thread. */
- else if (remaining.tv_sec != newval.it_value.tv_sec ||
- remaining.tv_usec != newval.it_value.tv_usec)
+ else if (remaining.tv_sec != newval.it_value.tv_sec
+ || remaining.tv_usec != newval.it_value.tv_usec)
{
/* The timeout value is changing. Tell the itimer thread to
reexamine it and start counting down. If the itimer thread is
@@ -349,7 +354,7 @@ __setitimer (enum __itimer_which which, const struct itimerval *new,
crit = _hurd_critical_section_lock ();
__spin_lock (&_hurd_itimer_lock);
- return setitimer_locked (new, old, crit);
+ return setitimer_locked (new, old, crit, 0);
}
static void
@@ -364,7 +369,7 @@ fork_itimer (void)
it = _hurd_itimerval;
it.it_value = it.it_interval;
- setitimer_locked (&it, NULL, NULL);
+ setitimer_locked (&it, NULL, NULL, 0);
(void) &fork_itimer; /* Avoid gcc optimizing out the function. */
}
diff --git a/sysdeps/mach/hurd/setlogin.c b/sysdeps/mach/hurd/setlogin.c
index bb12e81a52..fe5402e3af 100644
--- a/sysdeps/mach/hurd/setlogin.c
+++ b/sysdeps/mach/hurd/setlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setpgid.c b/sysdeps/mach/hurd/setpgid.c
index 98b1341cfa..7f2d29d7c8 100644
--- a/sysdeps/mach/hurd/setpgid.c
+++ b/sysdeps/mach/hurd/setpgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setpriority.c b/sysdeps/mach/hurd/setpriority.c
index a9c263491d..7f764485dd 100644
--- a/sysdeps/mach/hurd/setpriority.c
+++ b/sysdeps/mach/hurd/setpriority.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <hurd.h>
#include <hurd/resource.h>
diff --git a/sysdeps/mach/hurd/setregid.c b/sysdeps/mach/hurd/setregid.c
index 45953474b7..d831b1298b 100644
--- a/sysdeps/mach/hurd/setregid.c
+++ b/sysdeps/mach/hurd/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c
index d09935d8b0..f62273856f 100644
--- a/sysdeps/mach/hurd/setresgid.c
+++ b/sysdeps/mach/hurd/setresgid.c
@@ -1,5 +1,5 @@
/* setresgid -- set real group ID, effective group ID, and saved-set group ID
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c
index 3ed7dfd021..ed73dce098 100644
--- a/sysdeps/mach/hurd/setresuid.c
+++ b/sysdeps/mach/hurd/setresuid.c
@@ -1,5 +1,5 @@
/* setresuid -- set real user ID, effective user ID, and saved-set user ID
- Copyright (C) 2002-2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setreuid.c b/sysdeps/mach/hurd/setreuid.c
index 12548b375b..e751f586b1 100644
--- a/sysdeps/mach/hurd/setreuid.c
+++ b/sysdeps/mach/hurd/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/types.h>
diff --git a/sysdeps/mach/hurd/setrlimit.c b/sysdeps/mach/hurd/setrlimit.c
index 8866f05935..068aed37ac 100644
--- a/sysdeps/mach/hurd/setrlimit.c
+++ b/sysdeps/mach/hurd/setrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
diff --git a/sysdeps/mach/hurd/setsid.c b/sysdeps/mach/hurd/setsid.c
index 7b989361d1..1022e06a23 100644
--- a/sysdeps/mach/hurd/setsid.c
+++ b/sysdeps/mach/hurd/setsid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setsockopt.c b/sysdeps/mach/hurd/setsockopt.c
index c837a7c9e9..2dea360712 100644
--- a/sysdeps/mach/hurd/setsockopt.c
+++ b/sysdeps/mach/hurd/setsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/setuid.c b/sysdeps/mach/hurd/setuid.c
index e3c0120c98..b0bcee8d4f 100644
--- a/sysdeps/mach/hurd/setuid.c
+++ b/sysdeps/mach/hurd/setuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/setxattr.c b/sysdeps/mach/hurd/setxattr.c
index ea23652190..7b728c8b4e 100644
--- a/sysdeps/mach/hurd/setxattr.c
+++ b/sysdeps/mach/hurd/setxattr.c
@@ -1,5 +1,5 @@
/* Access to extended attributes on files. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/xattr.h>
diff --git a/sysdeps/mach/hurd/shutdown.c b/sysdeps/mach/hurd/shutdown.c
index 484820f275..bad28ba35d 100644
--- a/sysdeps/mach/hurd/shutdown.c
+++ b/sysdeps/mach/hurd/shutdown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/sigaction.c b/sysdeps/mach/hurd/sigaction.c
index 5f010064c9..39ce9a1388 100644
--- a/sysdeps/mach/hurd/sigaction.c
+++ b/sysdeps/mach/hurd/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <signal.h>
@@ -30,10 +30,10 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
struct sigaction a, old;
sigset_t pending;
- if (sig <= 0 || sig >= NSIG ||
- (act != NULL && act->sa_handler != SIG_DFL &&
- ((__sigmask (sig) & _SIG_CANT_MASK) ||
- act->sa_handler == SIG_ERR)))
+ if (sig <= 0 || sig >= NSIG
+ || (act != NULL && act->sa_handler != SIG_DFL
+ && ((__sigmask (sig) & _SIG_CANT_MASK)
+ || act->sa_handler == SIG_ERR)))
{
errno = EINVAL;
return -1;
@@ -51,8 +51,8 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
if (act != NULL)
ss->actions[sig] = a;
- if (act != NULL && sig == SIGCHLD &&
- (a.sa_flags & SA_NOCLDSTOP) != (old.sa_flags & SA_NOCLDSTOP))
+ if (act != NULL && sig == SIGCHLD
+ && (a.sa_flags & SA_NOCLDSTOP) != (old.sa_flags & SA_NOCLDSTOP))
{
__spin_unlock (&ss->lock);
diff --git a/sysdeps/mach/hurd/sigaltstack.c b/sysdeps/mach/hurd/sigaltstack.c
index 44b019aaf2..0c51870d4d 100644
--- a/sysdeps/mach/hurd/sigaltstack.c
+++ b/sysdeps/mach/hurd/sigaltstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
@@ -36,8 +36,9 @@ __sigaltstack (const stack_t *argss, stack_t *oss)
s = _hurd_self_sigstate ();
__spin_lock (&s->lock);
- if (argss != NULL &&
- (ss.ss_flags & SS_DISABLE) && (s->sigaltstack.ss_flags & SS_ONSTACK))
+ if (argss != NULL
+ && (ss.ss_flags & SS_DISABLE)
+ && (s->sigaltstack.ss_flags & SS_ONSTACK))
{
/* Can't disable a stack that is in use. */
__spin_unlock (&s->lock);
diff --git a/sysdeps/mach/hurd/siglist.h b/sysdeps/mach/hurd/siglist.h
index 193ca6dec2..fbec044d10 100644
--- a/sysdeps/mach/hurd/siglist.h
+++ b/sysdeps/mach/hurd/siglist.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/* This file is included multiple times. */
diff --git a/sysdeps/mach/hurd/sigpending.c b/sysdeps/mach/hurd/sigpending.c
index ea41ddc427..397d5ecd22 100644
--- a/sysdeps/mach/hurd/sigpending.c
+++ b/sysdeps/mach/hurd/sigpending.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/sigprocmask.c b/sysdeps/mach/hurd/sigprocmask.c
index e2587afcbc..240c4290df 100644
--- a/sysdeps/mach/hurd/sigprocmask.c
+++ b/sysdeps/mach/hurd/sigprocmask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <signal.h>
diff --git a/sysdeps/mach/hurd/sigstack.c b/sysdeps/mach/hurd/sigstack.c
index d87d220e39..465834052b 100644
--- a/sysdeps/mach/hurd/sigstack.c
+++ b/sysdeps/mach/hurd/sigstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <signal.h>
diff --git a/sysdeps/mach/hurd/sigsuspend.c b/sysdeps/mach/hurd/sigsuspend.c
index 7da3897722..9551285a70 100644
--- a/sysdeps/mach/hurd/sigsuspend.c
+++ b/sysdeps/mach/hurd/sigsuspend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c
index ce17cce895..b70f7685b3 100644
--- a/sysdeps/mach/hurd/sigwait.c
+++ b/sysdeps/mach/hurd/sigwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/socket.c b/sysdeps/mach/hurd/socket.c
index 43f2c3b2b5..b3bdc93a15 100644
--- a/sysdeps/mach/hurd/socket.c
+++ b/sysdeps/mach/hurd/socket.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/socket.h>
diff --git a/sysdeps/mach/hurd/socketpair.c b/sysdeps/mach/hurd/socketpair.c
index 6dce208157..5eb2252994 100644
--- a/sysdeps/mach/hurd/socketpair.c
+++ b/sysdeps/mach/hurd/socketpair.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 9351c13e56..e6b032b8a4 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -1,5 +1,5 @@
/* spawn a new process running an executable. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
+ not, see <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
@@ -113,6 +113,9 @@ __spawni (pid_t *pid, const char *file,
struct hurd_userlink *ulink_dtable = NULL;
struct hurd_sigstate *ss;
+ /* Child current working dir */
+ file_t ccwdir = MACH_PORT_NULL;
+
/* For POSIX_SPAWN_RESETIDS, this reauthenticates our root/current
directory ports with the new AUTH port. */
file_t rcrdir = MACH_PORT_NULL, rcwdir = MACH_PORT_NULL;
@@ -123,16 +126,25 @@ __spawni (pid_t *pid, const char *file,
if (*result != MACH_PORT_NULL)
return 0;
ref = __mach_reply_port ();
- err = HURD_PORT_USE
- (&_hurd_ports[which],
- ({
- err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
- if (!err)
- err = __auth_user_authenticate (auth,
- ref, MACH_MSG_TYPE_MAKE_SEND,
- result);
- err;
- }));
+ if (which == INIT_PORT_CWDIR && ccwdir != MACH_PORT_NULL)
+ {
+ err = __io_reauthenticate (ccwdir, ref, MACH_MSG_TYPE_MAKE_SEND);
+ if (!err)
+ err = __auth_user_authenticate (auth,
+ ref, MACH_MSG_TYPE_MAKE_SEND,
+ result);
+ }
+ else
+ err = HURD_PORT_USE
+ (&_hurd_ports[which],
+ ({
+ err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
+ if (!err)
+ err = __auth_user_authenticate (auth,
+ ref, MACH_MSG_TYPE_MAKE_SEND,
+ result);
+ err;
+ }));
__mach_port_destroy (__mach_task_self (), ref);
return err;
}
@@ -177,6 +189,14 @@ __spawni (pid_t *pid, const char *file,
return (reauthenticate (INIT_PORT_CWDIR, &rcwdir)
?: (*operate) (rcwdir));
}
+ else
+ switch (which)
+ {
+ case INIT_PORT_CWDIR:
+ if (ccwdir != MACH_PORT_NULL)
+ return (*operate) (ccwdir);
+ break;
+ }
assert (which != INIT_PORT_PROC);
return _hurd_ports_use (which, operate);
}
@@ -205,6 +225,80 @@ __spawni (pid_t *pid, const char *file,
return __hurd_file_name_lookup (&child_init_port, &child_fd, 0,
file, oflag, mode, result);
}
+ auto error_t child_chdir (const char *name)
+ {
+ file_t new_ccwdir;
+
+ /* Append trailing "/." to directory name to force ENOTDIR if
+ it's not a directory and EACCES if we don't have search
+ permission. */
+ len = strlen (name);
+ const char *lookup = name;
+ if (len >= 2 && name[len - 2] == '/' && name[len - 1] == '.')
+ lookup = name;
+ else if (len == 0)
+ /* Special-case empty file name according to POSIX. */
+ return __hurd_fail (ENOENT);
+ else
+ {
+ char *n = alloca (len + 3);
+ memcpy (n, name, len);
+ n[len] = '/';
+ n[len + 1] = '.';
+ n[len + 2] = '\0';
+ lookup = n;
+ }
+
+ error_t err = child_lookup (lookup, 0, 0, &new_ccwdir);
+ if (!err)
+ {
+ if (ccwdir != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), ccwdir);
+ ccwdir = new_ccwdir;
+ }
+
+ return err;
+ }
+ inline error_t child_lookup_under (file_t startdir, const char *file,
+ int oflag, mode_t mode, file_t *result)
+ {
+ error_t use_init_port (int which, error_t (*operate) (mach_port_t))
+ {
+ return (which == INIT_PORT_CWDIR ? (*operate) (startdir)
+ : child_init_port (which, operate));
+ }
+
+ return __hurd_file_name_lookup (&use_init_port, &child_fd, 0,
+ file, oflag, mode, result);
+ }
+ auto error_t child_fchdir (int fd)
+ {
+ file_t new_ccwdir;
+ error_t err;
+
+ if ((unsigned int)fd >= dtablesize
+ || dtable[fd] == MACH_PORT_NULL)
+ return EBADF;
+
+ /* We look up "." to force ENOTDIR if it's not a directory and EACCES if
+ we don't have search permission. */
+ if (dtable_cells[fd] != NULL)
+ err = HURD_PORT_USE (dtable_cells[fd],
+ ({
+ child_lookup_under (port, ".", O_NOTRANS, 0, &new_ccwdir);
+ }));
+ else
+ err = child_lookup_under (dtable[fd], ".", O_NOTRANS, 0, &new_ccwdir);
+
+ if (!err)
+ {
+ if (ccwdir != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), ccwdir);
+ ccwdir = new_ccwdir;
+ }
+
+ return err;
+ }
/* Do this once. */
@@ -351,7 +445,7 @@ __spawni (pid_t *pid, const char *file,
dtable = __alloca (dtablesize * sizeof (dtable[0]));
ulink_dtable = __alloca (dtablesize * sizeof (ulink_dtable[0]));
dtable_cells = __alloca (dtablesize * sizeof (dtable_cells[0]));
- dtable_cloexec = __alloca (dtablesize);
+ dtable_cloexec = __alloca (orig_dtablesize);
for (i = 0; i < dtablesize; ++i)
{
struct hurd_fd *const d = _hurd_dtable[i];
@@ -403,7 +497,7 @@ __spawni (pid_t *pid, const char *file,
{ \
/* We need to expand the dtable for the child. */ \
NEW_TABLE (dtable, newfd); \
- NEW_TABLE (ulink_dtable, newfd); \
+ NEW_ULINK_TABLE (ulink_dtable, newfd); \
NEW_TABLE (dtable_cells, newfd); \
dtablesize = newfd + 1; \
} \
@@ -414,6 +508,16 @@ __spawni (pid_t *pid, const char *file,
memcpy (new_##x, x, dtablesize * sizeof (x[0])); \
memset (&new_##x[dtablesize], 0, (newfd + 1 - dtablesize) * sizeof (x[0])); \
x = new_##x; } while (0)
+#define NEW_ULINK_TABLE(x, newfd) \
+ do { __typeof (x) new_##x = __alloca ((newfd + 1) * sizeof (x[0])); \
+ unsigned i; \
+ for (i = 0; i < dtablesize; i++) \
+ if (dtable_cells[i] != NULL) \
+ _hurd_port_move (dtable_cells[i], &new_##x[i], &x[i]); \
+ else \
+ memset (&new_##x[i], 0, sizeof (new_##x[i])); \
+ memset (&new_##x[dtablesize], 0, (newfd + 1 - dtablesize) * sizeof (x[0])); \
+ x = new_##x; } while (0)
struct __spawn_action *action = &file_actions->__actions[i];
@@ -485,6 +589,14 @@ __spawni (pid_t *pid, const char *file,
dtable_cells[fd] = NULL;
break;
}
+
+ case spawn_do_chdir:
+ err = child_chdir (action->action.chdir_action.path);
+ break;
+
+ case spawn_do_fchdir:
+ err = child_fchdir (action->action.fchdir_action.fd);
+ break;
}
if (err)
@@ -561,10 +673,10 @@ __spawni (pid_t *pid, const char *file,
/* There is no `PATH' in the environment.
The default search path is the current directory
followed by the path `confstr' returns for `_CS_PATH'. */
- len = confstr (_CS_PATH, (char *) NULL, 0);
+ len = __confstr (_CS_PATH, (char *) NULL, 0);
path = (char *) __alloca (1 + len);
path[0] = ':';
- (void) confstr (_CS_PATH, path + 1, len);
+ (void) __confstr (_CS_PATH, path + 1, len);
}
len = strlen (file) + 1;
@@ -708,6 +820,11 @@ __spawni (pid_t *pid, const char *file,
ports[i] = rcwdir;
continue;
}
+ if (ccwdir != MACH_PORT_NULL)
+ {
+ ports[i] = ccwdir;
+ continue;
+ }
break;
}
ports[i] = _hurd_port_get (&_hurd_ports[i], &ulink_ports[i]);
@@ -748,6 +865,8 @@ __spawni (pid_t *pid, const char *file,
case INIT_PORT_CWDIR:
if (flags & POSIX_SPAWN_RESETIDS)
continue;
+ if (ccwdir != MACH_PORT_NULL)
+ continue;
break;
}
_hurd_port_free (&_hurd_ports[i], &ulink_ports[i], ports[i]);
@@ -773,6 +892,8 @@ __spawni (pid_t *pid, const char *file,
}
__mach_port_deallocate (__mach_task_self (), auth);
__mach_port_deallocate (__mach_task_self (), proc);
+ if (ccwdir != MACH_PORT_NULL)
+ __mach_port_deallocate (__mach_task_self (), ccwdir);
if (rcrdir != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), rcrdir);
if (rcwdir != MACH_PORT_NULL)
diff --git a/sysdeps/mach/hurd/statfs.c b/sysdeps/mach/hurd/statfs.c
index b64eae5182..ba012a3144 100644
--- a/sysdeps/mach/hurd/statfs.c
+++ b/sysdeps/mach/hurd/statfs.c
@@ -1,5 +1,5 @@
/* statfs -- Return information about the filesystem on which FILE resides.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
diff --git a/sysdeps/mach/hurd/statfs64.c b/sysdeps/mach/hurd/statfs64.c
index 1697079fc3..000c325856 100644
--- a/sysdeps/mach/hurd/statfs64.c
+++ b/sysdeps/mach/hurd/statfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/statfsconv.c b/sysdeps/mach/hurd/statfsconv.c
index 4a699d10a6..adcbd65fe8 100644
--- a/sysdeps/mach/hurd/statfsconv.c
+++ b/sysdeps/mach/hurd/statfsconv.c
@@ -1,5 +1,5 @@
/* Convert between `struct statfs' format, and `struct statfs64' format.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/statvfs.c b/sysdeps/mach/hurd/statvfs.c
index 92e197806d..6e45ca236b 100644
--- a/sysdeps/mach/hurd/statvfs.c
+++ b/sysdeps/mach/hurd/statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <sys/statvfs.h>
diff --git a/sysdeps/mach/hurd/statvfs64.c b/sysdeps/mach/hurd/statvfs64.c
index f6dd8feda8..d175b6a33b 100644
--- a/sysdeps/mach/hurd/statvfs64.c
+++ b/sysdeps/mach/hurd/statvfs64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/statfs.h>
#include <sys/statvfs.h>
diff --git a/sysdeps/mach/hurd/symlink.c b/sysdeps/mach/hurd/symlink.c
index d8a31ec458..42469ae037 100644
--- a/sysdeps/mach/hurd/symlink.c
+++ b/sysdeps/mach/hurd/symlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <string.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c
index 4c4eaaaee7..42bd9b2885 100644
--- a/sysdeps/mach/hurd/symlinkat.c
+++ b/sysdeps/mach/hurd/symlinkat.c
@@ -1,5 +1,5 @@
/* Create a symbolic link named relative to an open directory. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/sync.c b/sysdeps/mach/hurd/sync.c
index ed5709ca34..0031c248cd 100644
--- a/sysdeps/mach/hurd/sync.c
+++ b/sysdeps/mach/hurd/sync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/syncfs.c b/sysdeps/mach/hurd/syncfs.c
index eb57f5dfed..57d7ed444b 100644
--- a/sysdeps/mach/hurd/syncfs.c
+++ b/sysdeps/mach/hurd/syncfs.c
@@ -1,6 +1,6 @@
/* Make all changes done to all files on the file system associated
with FD actually appear on disk.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/sysconf.c b/sysdeps/mach/hurd/sysconf.c
index b9d837a83f..3fe9a3af3b 100644
--- a/sysdeps/mach/hurd/sysconf.c
+++ b/sysdeps/mach/hurd/sysconf.c
@@ -1,5 +1,5 @@
/* Return values of system parameters. Hurd version.
- Copyright (C) 2012-2018 Free Software Foundation, Inc.
+ Copyright (C) 2012-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <limits.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/sysdep-cancel.h b/sysdeps/mach/hurd/sysdep-cancel.h
index ec55c7330f..f686a39024 100644
--- a/sysdeps/mach/hurd/sysdep-cancel.h
+++ b/sysdeps/mach/hurd/sysdep-cancel.h
@@ -6,4 +6,3 @@
#define RTLD_SINGLE_THREAD_P (0)
#define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */
#define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */
-#define LIBC_CANCEL_HANDLED() /* Nothing. */
diff --git a/sysdeps/mach/hurd/telldir.c b/sysdeps/mach/hurd/telldir.c
index 5ff62f359f..049dbca912 100644
--- a/sysdeps/mach/hurd/telldir.c
+++ b/sysdeps/mach/hurd/telldir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/times.c b/sysdeps/mach/hurd/times.c
index 246280115a..56a0062cd5 100644
--- a/sysdeps/mach/hurd/times.c
+++ b/sysdeps/mach/hurd/times.c
@@ -1,5 +1,5 @@
/* Return CPU and real time used by process and its children. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
@@ -42,7 +42,7 @@ __times (struct tms *tms)
struct task_basic_info bi;
struct task_thread_times_info tti;
mach_msg_type_number_t count;
- union { time_value_t tvt; struct timeval tv; } now;
+ time_value_t now;
error_t err;
count = TASK_BASIC_INFO_COUNT;
@@ -65,10 +65,9 @@ __times (struct tms *tms)
/* XXX This can't be implemented until getrusage(RUSAGE_CHILDREN) can be. */
tms->tms_cutime = tms->tms_cstime = 0;
- if (__gettimeofday (&now.tv, NULL) < 0)
- return -1;
+ __host_get_time (__mach_host_self (), &now);
- return (clock_from_time_value (&now.tvt)
+ return (clock_from_time_value (&now)
- clock_from_time_value (&bi.creation_time));
}
weak_alias (__times, times)
diff --git a/sysdeps/mach/hurd/tls.h b/sysdeps/mach/hurd/tls.h
index 67c657b655..a7b3575f01 100644
--- a/sysdeps/mach/hurd/tls.h
+++ b/sysdeps/mach/hurd/tls.h
@@ -1,5 +1,5 @@
/* Definitions for thread-local data handling. Hurd version.
- Copyright (C) 2003-2018 Free Software Foundation, Inc.
+ Copyright (C) 2003-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef _TLS_H
#define _TLS_H
diff --git a/sysdeps/mach/hurd/tmpfile.c b/sysdeps/mach/hurd/tmpfile.c
index 488bb6ae2b..232957a743 100644
--- a/sysdeps/mach/hurd/tmpfile.c
+++ b/sysdeps/mach/hurd/tmpfile.c
@@ -1,5 +1,5 @@
/* Open a stdio stream on an anonymous temporary file. Hurd version.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/truncate.c b/sysdeps/mach/hurd/truncate.c
index e3fc452511..06d47098b7 100644
--- a/sysdeps/mach/hurd/truncate.c
+++ b/sysdeps/mach/hurd/truncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/truncate64.c b/sysdeps/mach/hurd/truncate64.c
index 0d30a1cc01..10a8a53fd8 100644
--- a/sysdeps/mach/hurd/truncate64.c
+++ b/sysdeps/mach/hurd/truncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/ttyname.c b/sysdeps/mach/hurd/ttyname.c
index f500095650..3e5b54a400 100644
--- a/sysdeps/mach/hurd/ttyname.c
+++ b/sysdeps/mach/hurd/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index b307080b6d..7e1bac0b08 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <string.h>
diff --git a/sysdeps/mach/hurd/umask.c b/sysdeps/mach/hurd/umask.c
index 420e35a5fc..b447811d5d 100644
--- a/sysdeps/mach/hurd/umask.c
+++ b/sysdeps/mach/hurd/umask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/stat.h>
#include <hurd.h>
diff --git a/sysdeps/mach/hurd/uname.c b/sysdeps/mach/hurd/uname.c
index 2d5323e32d..d85626cc81 100644
--- a/sysdeps/mach/hurd/uname.c
+++ b/sysdeps/mach/hurd/uname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <sys/utsname.h>
diff --git a/sysdeps/mach/hurd/unlink.c b/sysdeps/mach/hurd/unlink.c
index 6376fefd57..7857722dad 100644
--- a/sysdeps/mach/hurd/unlink.c
+++ b/sysdeps/mach/hurd/unlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stddef.h>
diff --git a/sysdeps/mach/hurd/unlinkat.c b/sysdeps/mach/hurd/unlinkat.c
index f20a0f20a0..673ffb271d 100644
--- a/sysdeps/mach/hurd/unlinkat.c
+++ b/sysdeps/mach/hurd/unlinkat.c
@@ -1,5 +1,5 @@
/* unlinkat -- Remove a name relative to an open directory. Hurd version.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/utime-helper.c b/sysdeps/mach/hurd/utime-helper.c
index 6aed3316a7..136059dd01 100644
--- a/sysdeps/mach/hurd/utime-helper.c
+++ b/sysdeps/mach/hurd/utime-helper.c
@@ -1,5 +1,5 @@
/* Helpers for utimes/utimens conversions.
- Copyright (C) 2015-2018 Free Software Foundation, Inc.
+ Copyright (C) 2015-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <hurd/hurd_types.h>
diff --git a/sysdeps/mach/hurd/utimensat.c b/sysdeps/mach/hurd/utimensat.c
index ac9bc534c8..2ae73ad0f0 100644
--- a/sysdeps/mach/hurd/utimensat.c
+++ b/sysdeps/mach/hurd/utimensat.c
@@ -1,5 +1,5 @@
/* Change access and modification times of open file. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/utimes.c b/sysdeps/mach/hurd/utimes.c
index bdf4d79790..962e536def 100644
--- a/sysdeps/mach/hurd/utimes.c
+++ b/sysdeps/mach/hurd/utimes.c
@@ -1,5 +1,5 @@
/* utimes -- change access and modification times of file. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <errno.h>
diff --git a/sysdeps/mach/hurd/wait4.c b/sysdeps/mach/hurd/wait4.c
index a72bcee145..78ad33e8f5 100644
--- a/sysdeps/mach/hurd/wait4.c
+++ b/sysdeps/mach/hurd/wait4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/sysdeps/mach/hurd/write.c b/sysdeps/mach/hurd/write.c
index 3cf748be9d..f7832bd6c8 100644
--- a/sysdeps/mach/hurd/write.c
+++ b/sysdeps/mach/hurd/write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
diff --git a/sysdeps/mach/hurd/x86/dl-sysdep.c b/sysdeps/mach/hurd/x86/dl-sysdep.c
index abb488cde9..5a39c91cd8 100644
--- a/sysdeps/mach/hurd/x86/dl-sysdep.c
+++ b/sysdeps/mach/hurd/x86/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Operating system support for run-time dynamic linker. X86 version.
- Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ Copyright (C) 2017-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <config.h>
#include <sysdeps/x86/cpu-tunables.c>
diff --git a/sysdeps/mach/hurd/xmknod.c b/sysdeps/mach/hurd/xmknod.c
index d6b8adce9b..19ee49cb31 100644
--- a/sysdeps/mach/hurd/xmknod.c
+++ b/sysdeps/mach/hurd/xmknod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
diff --git a/sysdeps/mach/hurd/xmknodat.c b/sysdeps/mach/hurd/xmknodat.c
index e4e866c4f4..da470d8ebc 100644
--- a/sysdeps/mach/hurd/xmknodat.c
+++ b/sysdeps/mach/hurd/xmknodat.c
@@ -1,5 +1,5 @@
/* Create a device file relative to an open directory. Hurd version.
- Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ Copyright (C) 1991-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/stat.h>
diff --git a/sysdeps/mach/hurd/xstat.c b/sysdeps/mach/hurd/xstat.c
index 46314706f3..cf66a0deb7 100644
--- a/sysdeps/mach/hurd/xstat.c
+++ b/sysdeps/mach/hurd/xstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/stat.h>
diff --git a/sysdeps/mach/hurd/xstat64.c b/sysdeps/mach/hurd/xstat64.c
index f3a8ddc6e7..58fec10652 100644
--- a/sysdeps/mach/hurd/xstat64.c
+++ b/sysdeps/mach/hurd/xstat64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 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
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#ifndef RTLD_STAT64 /* dl-xstat64.c, but we don't want it. */
diff --git a/sysdeps/mach/hurd/xstatconv.c b/sysdeps/mach/hurd/xstatconv.c
index 1aa8aff317..af23544093 100644
--- a/sysdeps/mach/hurd/xstatconv.c
+++ b/sysdeps/mach/hurd/xstatconv.c
@@ -1,5 +1,5 @@
/* Convert between `struct stat' format, and `struct stat64' format.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2019 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
@@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/stat.h>