[Glibc-bsd-commits] r4435 - trunk/glibc-ports/kfreebsd
Petr Salinger
ps-guest at alioth.debian.org
Tue May 14 03:56:41 UTC 2013
Author: ps-guest
Date: 2013-05-14 03:56:40 +0000 (Tue, 14 May 2013)
New Revision: 4435
Removed:
trunk/glibc-ports/kfreebsd/fchmodat.c
trunk/glibc-ports/kfreebsd/fchownat.c
trunk/glibc-ports/kfreebsd/fexecve.c
trunk/glibc-ports/kfreebsd/ftruncate.c
trunk/glibc-ports/kfreebsd/linkat.c
trunk/glibc-ports/kfreebsd/lseek.c
trunk/glibc-ports/kfreebsd/mkdirat.c
trunk/glibc-ports/kfreebsd/pread.c
trunk/glibc-ports/kfreebsd/pselect.c
trunk/glibc-ports/kfreebsd/pwrite.c
trunk/glibc-ports/kfreebsd/readlinkat.c
trunk/glibc-ports/kfreebsd/renameat.c
trunk/glibc-ports/kfreebsd/shm_open.c
trunk/glibc-ports/kfreebsd/shm_unlink.c
trunk/glibc-ports/kfreebsd/symlinkat.c
trunk/glibc-ports/kfreebsd/truncate.c
trunk/glibc-ports/kfreebsd/unlinkat.c
Modified:
trunk/glibc-ports/kfreebsd/Makefile
trunk/glibc-ports/kfreebsd/Versions
trunk/glibc-ports/kfreebsd/dl-openat64.c
trunk/glibc-ports/kfreebsd/faccessat.c
trunk/glibc-ports/kfreebsd/futimesat.c
trunk/glibc-ports/kfreebsd/fxstatat.c
trunk/glibc-ports/kfreebsd/fxstatat64.c
trunk/glibc-ports/kfreebsd/mmap.c
trunk/glibc-ports/kfreebsd/openat.c
trunk/glibc-ports/kfreebsd/syscalls.list
trunk/glibc-ports/kfreebsd/testrtsig.h
trunk/glibc-ports/kfreebsd/xmknodat.c
Log:
drop support for pre 8,1 kernels
Modified: trunk/glibc-ports/kfreebsd/Makefile
===================================================================
--- trunk/glibc-ports/kfreebsd/Makefile 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/Makefile 2013-05-14 03:56:40 UTC (rev 4435)
@@ -32,15 +32,13 @@
ifeq ($(subdir),io)
# For <unistd.h>.
-sysdep_routines += sys_access sys_faccessat sys_fchownat sys_fexecve sys_getcwd sys_linkat sys_lseek sys_freebsd6_lseek sys_readlinkat sys_symlinkat sys_unlinkat
+sysdep_routines += sys_access sys_faccessat sys_getcwd
# For <fcntl.h>.
sysdep_routines += sys_open sys_openat open_2
# For <sys/stat.h>.
-sysdep_routines += sys_fchmodat sys_fstat sys_fstatat sys_lstat sys_mkdirat sys_mkfifoat sys_mknod sys_mknodat sys_nfstat sys_nlstat sys_nstat sys_stat lchflags
+sysdep_routines += sys_fstat sys_fstatat sys_lstat sys_mkfifoat sys_mknod sys_mknodat sys_nfstat sys_nlstat sys_nstat sys_stat lchflags
# For <sys/statfs.h>.
sysdep_routines += fstatfs64 statfs64 sys_fstatfs sys_statfs
-# For <stdio.h>
-sysdep_routines += sys_renameat
# For <sys/times.h>.
sysdep_routines += sys_futimesat
# Other.
@@ -58,7 +56,7 @@
# For <sched.h>.
sysdep_routines += clone start_thread
# For <unistd.h>.
-sysdep_routines += sys_ftruncate sys_freebsd6_ftruncate sys_truncate sys_freebsd6_truncate getosreldate
+sysdep_routines += getosreldate
# For <sys/acl.h>.
sysdep_routines += acl_aclcheck_fd acl_aclcheck_file acl_delete_fd acl_delete_file acl_get_fd acl_get_file acl_set_fd acl_set_file
# For <sys/extattr.h>.
@@ -70,7 +68,7 @@
# For <sys/linker.h>.
sysdep_routines += kldfind kldfirstmod kldload kldnext kldstat kldsym kldunload kldunloadf
# For <sys/mman.h>.
-sysdep_routines += minherit sys_mmap sys_freebsd6_mmap sys_munmap
+sysdep_routines += minherit sys_mmap sys_munmap
# For <sys/mount.h>.
sysdep_routines += fhopen sys_fhstat sys_fhstatfs fhstat fhstat64 fhstatfs fhstatfs64 getfh getfsstat getfsstat64 sys_getfsstat getmntinfo getmntinfo64 mount nmount unmount
# For <sys/rfork.h>.
@@ -91,12 +89,12 @@
sysdep_routines += sys_fork sys_execve sys_sigaction sys_close sys_fcntl
sysdep_routines += sys_clock_getres sys_clock_gettime sys_clock_settime
sysdep_routines += sys_ktimer_create sys_ktimer_gettime sys_ktimer_settime sys_ktimer_getoverrun sys_ktimer_delete
-sysdep_routines += sys_shm_open sys_shm_unlink sys_pselect sys_semctl
+sysdep_routines += sys_semctl
endif
ifeq ($(subdir),posix)
# For <unistd.h>.
-sysdep_routines += sys_getlogin sys_pread sys_freebsd6_pread sys_pwrite sys_freebsd6_pwrite sys_setlogin sys_read sys_write
+sysdep_routines += sys_getlogin sys_setlogin sys_read sys_write
# for <sched.h>
sysdep_routines += sys_cpuset_getaffinity sys_cpuset_setaffinity
endif
Modified: trunk/glibc-ports/kfreebsd/Versions
===================================================================
--- trunk/glibc-ports/kfreebsd/Versions 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/Versions 2013-05-14 03:56:40 UTC (rev 4435)
@@ -109,10 +109,7 @@
# needed by librt as INLINE_SYSCALL:
__syscall_clock_getres; __syscall_clock_gettime; __syscall_clock_settime;
__syscall_ktimer_create; __syscall_ktimer_gettime; __syscall_ktimer_settime; __syscall_ktimer_getoverrun; __syscall_ktimer_delete;
- __syscall_shm_open; __syscall_shm_unlink;
# misc fixes for FreeBSD:
- __syscall_freebsd6_lseek; __syscall_freebsd6_pread; __syscall_freebsd6_pwrite;
- __syscall_lseek; __syscall_pread; __syscall_pwrite;
__syscall_connect; __syscall_sendto;
__syscall_cpuset_getaffinity ; __syscall_cpuset_setaffinity;
# global variable used in brk()
Modified: trunk/glibc-ports/kfreebsd/dl-openat64.c
===================================================================
--- trunk/glibc-ports/kfreebsd/dl-openat64.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/dl-openat64.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -21,6 +21,8 @@
#include <fcntl.h>
#include <sysdep.h>
+extern int __syscall_openat (int fd, const char *path, int flag, mode_t mode);
+libc_hidden_proto (__syscall_openat)
int
openat64 (dfd, file, oflag)
@@ -32,5 +34,3 @@
return INLINE_SYSCALL (openat, 4, dfd, file, oflag, 0);
}
-
-strong_alias (openat64, __openat_nocancel)
Modified: trunk/glibc-ports/kfreebsd/faccessat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/faccessat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/faccessat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -49,17 +49,7 @@
int mode;
int flag;
{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (faccessat, 4, fd, file, mode, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- {
+ int result = INLINE_SYSCALL (faccessat, 4, fd, file, mode, flag);
if ((result == 0) && (mode & X_OK))
{
uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
@@ -76,123 +66,4 @@
}
}
return result;
- }
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if ((!(flag & AT_EACCESS) || !__libc_enable_secure)
- && !(flag & AT_SYMLINK_NOFOLLOW))
- {
- /* If we are not set-uid or set-gid, access does the same. */
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf =
- (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __access (file, mode);
- }
-#endif
-
- struct stat64 stats;
- if (fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
- return -1;
-
- mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
-#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
-# error Oops, portability assumptions incorrect.
-#endif
-
- if (mode == F_OK)
- return 0; /* The file exists. */
-
- uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
-
- /* The super-user can read and write any file, and execute any file
- that anyone can execute. */
- if (uid == 0 && ((mode & X_OK) == 0
- || (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
- return 0;
-
- int granted = (uid == stats.st_uid
- ? (unsigned int) (stats.st_mode & (mode << 6)) >> 6
- : (stats.st_gid == ((flag & AT_EACCESS)
- ? __getegid () : __getgid ())
- || __group_member (stats.st_gid))
- ? (unsigned int) (stats.st_mode & (mode << 3)) >> 3
- : (stats.st_mode & mode));
-
- if (granted == mode)
- return 0;
-
- __set_errno (EACCES);
- return -1;
}
Deleted: trunk/glibc-ports/kfreebsd/fchmodat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/fchmodat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/fchmodat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,138 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_fchmodat (int fd, const char *path,
- mode_t mode, int flag);
-libc_hidden_proto (__syscall_fchmodat)
-
-/* This is specific to kFreeBSD. */
-extern int __lchmod (__const char *__file, __mode_t __mode);
-
-int
-fchmodat (fd, file, mode, flag)
- int fd;
- const char *file;
- mode_t mode;
- int flag;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (fchmodat, 4, fd, file, mode, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- return __lchmod(file, mode);
- else
- return __chmod(file, mode);
-#endif
-}
Deleted: trunk/glibc-ports/kfreebsd/fchownat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/fchownat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/fchownat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,137 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_fchownat (int fd, const char *path, uid_t uid,
- gid_t gid, int flag);
-libc_hidden_proto (__syscall_fchownat)
-
-/* Change the owner and group of FILE. */
-int
-fchownat (fd, file, owner, group, flag)
- int fd;
- const char *file;
- uid_t owner;
- gid_t group;
- int flag;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- return __lchown(file, owner, group);
- else
- return __chown(file, owner, group);
-#endif
-}
Deleted: trunk/glibc-ports/kfreebsd/fexecve.c
===================================================================
--- trunk/glibc-ports/kfreebsd/fexecve.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/fexecve.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,103 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_fexecve (int fd, char *const argv[], char *const envp[]);
-libc_hidden_proto (__syscall_fexecve);
-
-/* Execute the file FD refers to, overlaying the running program image.
- ARGV and ENVP are passed to the new program, as for `execve'. */
-int
-fexecve (fd, argv, envp)
- int fd;
- char *const argv[];
- char *const envp[];
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (fexecve, 3, fd, argv, envp);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (fd < 0 || argv == NULL || envp == NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type == KF_TYPE_VNODE &&
- kf->kf_vnode_type == KF_VTYPE_VREG)
- return __execve (kf->kf_path, argv, envp);
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- __set_errno (EINVAL);
- return -1;
-#endif
-}
Deleted: trunk/glibc-ports/kfreebsd/ftruncate.c
===================================================================
--- trunk/glibc-ports/kfreebsd/ftruncate.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/ftruncate.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,52 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Bruno Haible <bruno at clisp.org>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <errno.h>
-
-extern int __syscall_ftruncate (int __fd, __off_t __length) __THROW;
-libc_hidden_proto (__syscall_ftruncate)
-extern int __syscall_freebsd6_ftruncate (int __fd, int __unused1,
- __off_t __length) __THROW;
-libc_hidden_proto (__syscall_freebsd6_ftruncate)
-
-int
-__ftruncate (int fd, __off_t length)
-{
- int result;
-
- /* First try the new syscall. */
- result = INLINE_SYSCALL (ftruncate, 2, fd, length);
-
-#ifndef __ASSUME_TRUNCATE_SYSCALL
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_ftruncate, 3, fd, 0, length);
-#endif
-
- return result;
-}
-
-weak_alias (__ftruncate, ftruncate)
-
-/* 'ftruncate64' is the same as 'ftruncate', because __off64_t == __off_t. */
-strong_alias (__ftruncate, __ftruncate64)
-weak_alias (__ftruncate64, ftruncate64)
Modified: trunk/glibc-ports/kfreebsd/futimesat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/futimesat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/futimesat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -41,98 +41,8 @@
const char *file;
const struct timeval tvp[2];
{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result;
-
if (file == NULL)
return __futimes (fd, tvp);
- result = INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if ((file == NULL) || (fd != AT_FDCWD && file[0] != '/'))
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- if (file == NULL)
- kf_buf = alloca (kf_len);
- else
- kf_buf = alloca (kf_len + filelen);
-
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
- if (file != NULL)
- {
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- }
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __utimes(file, tvp);
-#endif
+ return INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
}
Modified: trunk/glibc-ports/kfreebsd/fxstatat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/fxstatat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/fxstatat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -40,10 +40,6 @@
int
__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
int result;
if (__builtin_expect (vers == _STAT_VER, 1))
@@ -66,93 +62,7 @@
__set_errno (EINVAL);
return -1;
}
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- return __lxstat (vers, file, st);
- else
- return __xstat (vers, file, st);
-#endif
}
libc_hidden_def (__fxstatat)
Modified: trunk/glibc-ports/kfreebsd/fxstatat64.c
===================================================================
--- trunk/glibc-ports/kfreebsd/fxstatat64.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/fxstatat64.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -40,10 +40,6 @@
int
__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
int result;
if (__builtin_expect (vers == _STAT_VER, 1))
@@ -60,93 +56,7 @@
__set_errno (EINVAL);
return -1;
}
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- return __lxstat64 (vers, file, st);
- else
- return __xstat64 (vers, file, st);
-#endif
}
libc_hidden_def (__fxstatat64)
Deleted: trunk/glibc-ports/kfreebsd/linkat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/linkat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/linkat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,181 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <stdio.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_linkat (int fd1, const char *path1, int fd2,
- const char *path2, int flags);
-libc_hidden_proto (__syscall_linkat)
-
-/* Make a link to FROM named TO but relative paths in TO and FROM are
- interpreted relative to FROMFD and TOFD respectively. */
-int
-linkat (fromfd, from, tofd, to, flags)
- int fromfd;
- const char *from;
- int tofd;
- const char *to;
- int flags;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (linkat, 5, fromfd, from, tofd, to, flags);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- /* Without kernel support we cannot handle AT_SYMLINK_FOLLOW. */
- if (flags != 0)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if ((fromfd != AT_FDCWD && from[0] != '/')
- || (tofd != AT_FDCWD && to[0] != '/'))
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t fromlen, tolen;
-
- if ((fromfd < 0) || (tofd < 0))
- {
- __set_errno (EBADF);
- return -1;
- }
-
- fromlen = strlen (from);
- tolen = strlen (to);
- if (__builtin_expect (fromlen == 0, 0)
- || __builtin_expect (tolen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- if (fromfd != AT_FDCWD && from[0] != '/')
- {
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf =
- (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fromfd)
- {
- char *buf;
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- buf = alloca (strlen (kf->kf_path) + fromlen + 2);
- strcpy(buf, kf->kf_path);
- strcat (buf, "/");
- strcat (buf, from);
- from = buf;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (tofd != AT_FDCWD && to[0] != '/')
- {
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf =
- (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == tofd)
- {
- char *buf;
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- buf = alloca (strlen (kf->kf_path) + tolen + 2);
- strcpy(buf, kf->kf_path);
- strcat (buf, "/");
- strcat (buf, to);
- to = buf;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
- }
-
- return __link (from, to);
-#endif
-}
Deleted: trunk/glibc-ports/kfreebsd/lseek.c
===================================================================
--- trunk/glibc-ports/kfreebsd/lseek.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/lseek.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,59 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Bruno Haible <bruno at clisp.org>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <errno.h>
-
-extern __off_t __syscall_lseek (int __fd, __off_t __offset, int __whence) __THROW;
-libc_hidden_proto (__syscall_lseek)
-extern __off_t __syscall_freebsd6_lseek (int __fd, int __unused1, __off_t __offset,
- int __whence) __THROW;
-libc_hidden_proto (__syscall_freebsd6_lseek)
-
-__off_t
-__libc_lseek (int fd, __off_t offset, int whence)
-{
- __off_t result;
-
- /* First try the new syscall. */
- result = INLINE_SYSCALL (lseek, 3, fd, offset, whence);
-
-#ifndef __ASSUME_LSEEK_SYSCALL
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_lseek, 4, fd, 0, offset, whence);
-#endif
-
- return result;
-}
-
-weak_alias (__libc_lseek, __lseek)
-libc_hidden_def (__lseek)
-weak_alias (__libc_lseek, lseek)
-
-/* 'lseek64' is the same as 'lseek', because __off64_t == __off_t. */
-strong_alias (__libc_lseek, __libc_lseek64)
-weak_alias (__libc_lseek64, __lseek64)
-weak_alias (__lseek64, lseek64)
-
-/* 'llseek' is the same as 'lseek', because __off64_t == __off_t. */
-strong_alias (__libc_lseek, __llseek)
-weak_alias (__llseek, llseek)
Deleted: trunk/glibc-ports/kfreebsd/mkdirat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/mkdirat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/mkdirat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,126 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write file the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Bosfilen, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_mkdirat (int fd, const char *path, mode_t mode);
-libc_hidden_proto (__syscall_mkdirat)
-
-/* Create a new direcfilery with permission bits MODE. But interpret
- relative PATH names relative file the direcfilery associated with FD. */
-int
-mkdirat (fd, file, mode)
- int fd;
- const char *file;
- mode_t mode;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (mkdirat, 3, fd, file, mode);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __mkdir (file, mode);
-#endif
-}
Modified: trunk/glibc-ports/kfreebsd/mmap.c
===================================================================
--- trunk/glibc-ports/kfreebsd/mmap.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/mmap.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -26,19 +26,10 @@
extern void *__syscall_mmap (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off_t __offset) __THROW;
libc_hidden_proto (__syscall_mmap)
-extern void *__syscall_freebsd6_mmap (void *__addr, size_t __len, int __prot,
- int __flags, int __fd, int __unused1,
- __off_t __offset) __THROW;
-libc_hidden_proto (__syscall_freebsd6_mmap)
-extern ssize_t __syscall_freebsd6_pread (int __fd, void *__buf, size_t __nbytes,
- int __unused1, __off_t __offset) __THROW;
-libc_hidden_proto (__syscall_freebsd6_pread)
void *
__mmap (void *addr, size_t len, int prot, int flags, int fd, __off_t offset)
{
- void *result;
-
/* Validity checks not done by the kernel. */
if (offset != 0)
{
@@ -56,27 +47,7 @@
if (flags & MAP_ANON)
fd = -1;
- /* First try the new syscall. */
- result = (void *) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
-
-#ifndef __ASSUME_MMAP_SYSCALL
- if (result == (void *) (-1) && errno == ENOSYS)
- {
- /* New syscall not available, use the old one. */
- result = (void *) INLINE_SYSCALL (freebsd6_mmap, 7, addr, len, prot, flags, fd, 0, offset);
- if (result != (void *) (-1) && fd >= 0 && len > 0)
- {
- /* Force an update of the atime. POSIX:2001 mandates that this happens
- at some time between the mmap() call and the first page-in. Since
- the FreeBSD 6.0 kernel doesn't update the atime upon a page-in, we
- do it here. */
- char dummy;
- INLINE_SYSCALL (freebsd6_pread, 5, fd, &dummy, 1, 0, offset);
- }
- }
-#endif
-
- return result;
+ return INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
}
weak_alias (__mmap, mmap)
Modified: trunk/glibc-ports/kfreebsd/openat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/openat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/openat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -34,111 +34,10 @@
extern int __syscall_openat (int fd, const char *path, int flag, mode_t mode);
libc_hidden_proto (__syscall_openat)
-# ifndef __ASSUME_ATFCTS
-int __have_atfcts = 0;
-#endif
-
/* Open FILE with access OFLAG. Interpret relative paths relative to
the directory associated with FD. If OFLAG includes O_CREAT, a
third argument is the file protection. */
int
-__openat_nocancel (fd, file, oflag, mode)
- int fd;
- const char *file;
- int oflag;
- mode_t mode;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (openat, 4, fd, file, oflag, mode);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- }
- return INLINE_SYSCALL (open, 3, file, oflag, mode);
-#endif
-}
-
-strong_alias (__openat_nocancel, __openat64_nocancel)
-
-/* Open FILE with access OFLAG. Interpret relative paths relative to
- the directory associated with FD. If OFLAG includes O_CREAT, a
- third argument is the file protection. */
-int
__openat (fd, file, oflag)
int fd;
const char *file;
@@ -156,11 +55,11 @@
}
if (SINGLE_THREAD_P)
- return __openat_nocancel(fd, file, oflag, mode);
+ return INLINE_SYSCALL (openat, 4, fd, file, oflag, mode);
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
- result = __openat_nocancel(fd, file, oflag, mode);
+ result = INLINE_SYSCALL (openat, 4, fd, file, oflag, mode);
LIBC_CANCEL_RESET (oldtype);
}
return result;
Deleted: trunk/glibc-ports/kfreebsd/pread.c
===================================================================
--- trunk/glibc-ports/kfreebsd/pread.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/pread.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,69 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Bruno Haible <bruno at clisp.org>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <sysdep-cancel.h>
-#include <errno.h>
-
-extern ssize_t __syscall_pread (int __fd, void *__buf, size_t __nbytes,
- __off_t __offset) __THROW;
-libc_hidden_proto(__syscall_pread)
-extern ssize_t __syscall_freebsd6_pread (int __fd, void *__buf, size_t __nbytes,
- int __unused1, __off_t __offset) __THROW;
-libc_hidden_proto(__syscall_freebsd6_pread)
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t nbytes, __off_t offset)
-{
- ssize_t result;
-
- if (SINGLE_THREAD_P)
- {
-
- /* First try the new syscall. */
- result = INLINE_SYSCALL (pread, 4, fd, buf, nbytes, offset);
-#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_pread, 5, fd, buf, nbytes, 0, offset);
-#endif
- return result;
- }
-
- int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the new syscall. */
- result = INLINE_SYSCALL (pread, 4, fd, buf, nbytes, offset);
-#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_pread, 5, fd, buf, nbytes, 0, offset);
-#endif
- LIBC_CANCEL_RESET (oldtype);
- return result;
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__pread, pread)
-
-/* 'pread64' is the same as 'pread', because __off64_t == __off_t. */
-strong_alias (__libc_pread, __libc_pread64)
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
Deleted: trunk/glibc-ports/kfreebsd/pselect.c
===================================================================
--- trunk/glibc-ports/kfreebsd/pselect.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/pselect.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,72 +0,0 @@
-/* Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/poll.h>
-#include <kernel-features.h>
-#include <sysdep-cancel.h>
-
-
-#ifndef __ASSUME_PSELECT
-static int __generic_pselect (int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds,
- const struct timespec *timeout,
- const sigset_t *sigmask);
-#endif
-
-extern int __syscall_pselect (int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds,
- const struct timespec *timeout,
- const sigset_t *sigmask) __THROW;
-
-int
-__pselect (int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds,
- const struct timespec *timeout,
- const sigset_t *sigmask)
-{
- int result;
-
- if (SINGLE_THREAD_P)
- result = INLINE_SYSCALL (pselect, 6, nfds, readfds, writefds, exceptfds,
- timeout, sigmask);
- else
- {
- int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pselect, 6, nfds, readfds, writefds, exceptfds,
- timeout, sigmask);
- LIBC_CANCEL_RESET (oldtype);
- }
-
-#ifndef __ASSUME_PSELECT
- if (result == -1 && errno == ENOSYS)
- return __generic_pselect (nfds, readfds, writefds, exceptfds,
- timeout, sigmask);
-#endif
-
- return result;
-}
-weak_alias (__pselect, pselect)
-strong_alias (__pselect, __libc_pselect)
-
-#ifndef __ASSUME_PSELECT
-# define __pselect static __generic_pselect
-# include <misc/pselect.c>
-#endif
Deleted: trunk/glibc-ports/kfreebsd/pwrite.c
===================================================================
--- trunk/glibc-ports/kfreebsd/pwrite.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/pwrite.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,68 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Bruno Haible <bruno at clisp.org>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <sysdep-cancel.h>
-#include <errno.h>
-
-extern ssize_t __syscall_pwrite (int __fd, const void *__buf, size_t __nbytes,
- __off_t __offset) __THROW;
-libc_hidden_proto(__syscall_pwrite)
-extern ssize_t __syscall_freebsd6_pwrite (int __fd, const void *__buf, size_t __nbytes,
- int __unused1, __off_t __offset) __THROW;
-libc_hidden_proto(__syscall_freebsd6_pwrite)
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t nbytes, __off_t offset)
-{
- ssize_t result;
-
- if (SINGLE_THREAD_P)
- {
- /* First try the new syscall. */
- result = INLINE_SYSCALL (pwrite, 4, fd, buf, nbytes, offset);
-#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_pwrite, 5, fd, buf, nbytes, 0, offset);
-#endif
- return result;
- }
-
- int oldtype = LIBC_CANCEL_ASYNC ();
- /* First try the new syscall. */
- result = INLINE_SYSCALL (pwrite, 4, fd, buf, nbytes, offset);
-#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_pwrite, 5, fd, buf, nbytes, 0, offset);
-#endif
- LIBC_CANCEL_RESET (oldtype);
- return result;
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__pwrite, pwrite)
-
-/* 'pwrite64' is the same as 'pwrite', because __off64_t == __off_t. */
-strong_alias (__libc_pwrite, __libc_pwrite64)
-weak_alias (__libc_pwrite64, __pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
Deleted: trunk/glibc-ports/kfreebsd/readlinkat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/readlinkat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/readlinkat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,130 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_readlinkat (int fd, const char *path, char *buf,
- size_t bufsize);
-libc_hidden_proto (__syscall_readlinkat)
-
-/* Read the contents of the symbolic link PATH relative to FD into no
- more than LEN bytes of BUF. */
-ssize_t
-readlinkat (fd, path, buf, len)
- int fd;
- const char *path;
- char *buf;
- size_t len;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (readlinkat, 4, fd, path, buf, len);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (fd != AT_FDCWD && path[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t pathlen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- pathlen = strlen (path);
- if (__builtin_expect (pathlen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + pathlen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, path);
- path = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __readlink (path, buf, len);
-#endif
-}
-
-libc_hidden_def (readlinkat)
Deleted: trunk/glibc-ports/kfreebsd/renameat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/renameat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/renameat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,174 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <stdio.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-libc_hidden_proto (rename)
-
-extern int __syscall_renameat (int oldfd, const char *old, int newfd,
- const char *new);
-libc_hidden_proto (__syscall_renameat)
-
-/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */
-int renameat (oldfd, old, newfd, new)
- int oldfd;
- const char *old;
- int newfd;
- const char *new;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (renameat, 4, oldfd, old, newfd, new);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if ((oldfd != AT_FDCWD && old[0] != '/')
- || (newfd != AT_FDCWD && new[0] != '/'))
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t old_filelen, new_filelen;
-
- if ((oldfd < 0) || (newfd < 0))
- {
- __set_errno (EBADF);
- return -1;
- }
-
- old_filelen = strlen (old);
- new_filelen = strlen (new);
- if (__builtin_expect (old_filelen == 0, 0)
- || __builtin_expect (new_filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- if (oldfd != AT_FDCWD && old[0] != '/')
- {
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf =
- (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == oldfd)
- {
- char *buf;
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- buf = alloca (strlen (kf->kf_path) + old_filelen + 2);
- strcpy(buf, kf->kf_path);
- strcat (buf, "/");
- strcat (buf, old);
- old = buf;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- if (newfd != AT_FDCWD && new[0] != '/')
- {
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf =
- (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == newfd)
- {
- char *buf;
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- buf = alloca (strlen (kf->kf_path) + new_filelen + 2);
- strcpy(buf, kf->kf_path);
- strcat (buf, "/");
- strcat (buf, new);
- new = buf;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
- }
-
-#define __rename rename /* there is no __rename */
- return __rename (old, new);
-#endif
-}
Deleted: trunk/glibc-ports/kfreebsd/shm_open.c
===================================================================
--- trunk/glibc-ports/kfreebsd/shm_open.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/shm_open.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,65 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sysdep.h>
-
-extern int __syscall_shm_open (const char *path, int flags, mode_t mode);
-libc_hidden_proto (__syscall_shm_open);
-
-/* Open shared memory object. */
-int
-shm_open (const char *name, int oflag, mode_t mode)
-{
- /* First try the new syscall. */
- int fd = INLINE_SYSCALL (shm_open, 3, name, oflag, mode);
-
-#ifndef __ASSUME_POSIXSHM_SYSCALL
- /* New syscall not available, use fallback code. */
- if (fd == -1 && errno == ENOSYS)
- {
- struct stat stab;
-
- if ((oflag & O_ACCMODE) == O_WRONLY)
- return (EINVAL);
-
- fd = __open (name, oflag, mode);
- if (fd != -1)
- {
- if (__fstat (fd, &stab) != 0 || !S_ISREG (stab.st_mode))
- {
- __close (fd);
- __set_errno (EINVAL);
- return -1;
- }
-
- if (__fcntl (fd, F_SETFL, (int) FPOSIXSHM) != 0)
- {
- __close (fd);
- return -1;
- }
- }
- }
-#endif
-
- return fd;
-}
Deleted: trunk/glibc-ports/kfreebsd/shm_unlink.c
===================================================================
--- trunk/glibc-ports/kfreebsd/shm_unlink.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/shm_unlink.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,48 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sysdep.h>
-
-extern int __syscall_shm_unlink (const char *name);
-libc_hidden_proto (__syscall_shm_unlink)
-
-libc_hidden_proto (__unlink)
-
-/* Unlink a shared memory object. */
-int
-shm_unlink (const char *name)
-{
- /* First try the new syscall. */
- int result = INLINE_SYSCALL (shm_unlink, 1, name);
-
-#ifndef __ASSUME_POSIXSHM_SYSCALL
- /* New syscall not available, simply unlink the file. */
- if (result == -1 && errno == ENOSYS)
-# ifdef NOT_IN_libc
- return unlink (name);
-# else
- return __unlink (name);
-# endif
-#endif
-
- return result;
-}
Deleted: trunk/glibc-ports/kfreebsd/symlinkat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/symlinkat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/symlinkat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,126 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_symlinkat (const char *path1, int fd,
- const char *path2);
-libc_hidden_proto (__syscall_symlinkat)
-
-/* Make a symbolic link to FROM named TO relative to TOFD. */
-int
-symlinkat (from, tofd, to)
- const char *from;
- int tofd;
- const char *to;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (symlinkat, 3, from, tofd, to);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (tofd != AT_FDCWD && to[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t tolen;
-
- if (tofd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- tolen = strlen (to);
- if (__builtin_expect (tolen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + tolen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == tofd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, to);
- to = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __symlink (from, to);
-#endif
-}
Modified: trunk/glibc-ports/kfreebsd/syscalls.list
===================================================================
--- trunk/glibc-ports/kfreebsd/syscalls.list 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/syscalls.list 2013-05-14 03:56:40 UTC (rev 4435)
@@ -36,8 +36,7 @@
sys_fstatfs - fstatfs i:ip __syscall_fstatfs
sys_fhstatfs - fhstatfs i:pp __syscall_fhstatfs
sys_fstat - fstat i:ip __syscall_fstat
-sys_ftruncate - ftruncate i:ii __syscall_ftruncate
-sys_freebsd6_ftruncate - freebsd6_ftruncate i:iii __syscall_freebsd6_ftruncate
+ftruncate - ftruncate i:ii __ftruncate !__ftruncate64 ftruncate ftruncate64
futimes - futimes i:ip __futimes futimes
sys_getcwd - getcwd i:bn __syscall_getcwd
sys_getdents - getdents i:ibn __syscall_getdents
@@ -73,8 +72,7 @@
lchmod - lchmod i:si __lchmod lchmod
lchown - lchown i:sii __lchown lchown
sys_lio_listio - lio_listio i:ibnP __syscall_lio_listio
-sys_lseek - lseek i:iii __syscall_lseek
-sys_freebsd6_lseek - freebsd6_lseek i:iiii __syscall_freebsd6_lseek
+lseek - lseek i:iii __libc_lseek !__lseek lseek !__libc_lseek64 !__lseek64 lseek64 !__llseek llseek
sys_lstat - lstat i:sp __syscall_lstat
lutimes - lutimes i:sp __lutimes lutimes
posix_madvise - madvise i:pii posix_madvise
@@ -85,7 +83,6 @@
mkfifo - mkfifo i:si __mkfifo mkfifo
sys_mknod - mknod i:sii __syscall_mknod
sys_mmap - mmap b:aniiii __syscall_mmap
-sys_freebsd6_mmap - freebsd6_mmap b:aniiiii __syscall_freebsd6_mmap
sys_munmap - munmap i:pi __syscall_munmap
modfind - modfind i:s modfind
modfnext - modfnext i:i modfnext
@@ -109,10 +106,8 @@
obreak - obreak i:a __syscall_obreak
sys_open - open i:siv __syscall_open
poll - poll Ci:pii __poll poll
-sys_pread - pread i:ibni __syscall_pread
-sys_freebsd6_pread - freebsd6_pread i:ibnii __syscall_freebsd6_pread
-sys_pwrite - pwrite i:ibni __syscall_pwrite
-sys_freebsd6_pwrite - freebsd6_pwrite i:ibnii __syscall_freebsd6_pwrite
+pread - pread Ci:ibni __libc_pread !__pread pread !__libc_pread64 !__pread64 pread64
+pwrite - pwrite Ci:ibni __libc_pwrite !__pwrite pwrite !__libc_pwrite64 !__pwrite64 pwrite64
preadv - preadv Ci:ipii __preadv preadv __preadv64 preadv64
pwritev - pwritev Ci:ipii __pwritev pwritev __pwritev64 pwritev64
quotactl - quotactl i:siip quotactl
@@ -154,8 +149,7 @@
sys_stat - stat i:sp __syscall_stat
sysarch - sysarch i:ip __sysarch sysarch
sysctl - sysctl i:pibNbn __sysctl sysctl
-sys_truncate - truncate i:sii __syscall_truncate
-sys_freebsd6_truncate - freebsd6_truncate i:si __syscall_freebsd6_truncate
+truncate - truncate i:sii __truncate !__truncate64 truncate truncate64
undelete - undelete i:s undelete
unmount - unmount i:si unmount
utrace - utrace i:bn utrace
@@ -182,21 +176,21 @@
sys_cpuset_getaffinity - cpuset_getaffinity i:iiiip __syscall_cpuset_getaffinity
sys_cpuset_setaffinity - cpuset_setaffinity i:iiiip __syscall_cpuset_setaffinity
sys_faccessat - faccessat i:isii __syscall_faccessat
-sys_fchmodat - fchmodat i:isii __syscall_fchmodat
-sys_fchownat - fchownat i:isiii __syscall_fchownat
-sys_fexecve - fexecve i:ipp __syscall_fexecve
+fchmodat - fchmodat i:isii fchmodat
+fchownat - fchownat i:isiii fchownat
+fexecve - fexecve i:ipp fexecve
sys_fstatat - fstatat i:ispi __syscall_fstatat
sys_futimesat - futimesat i:isp __syscall_futimesat
-sys_linkat - linkat i:isisi __syscall_linkat
-sys_mkdirat - mkdirat i:isi __syscall_mkdirat
+linkat - linkat i:isisi linkat
+mkdirat - mkdirat i:isi mkdirat
sys_mkfifoat - mkfifoat i:isi __syscall_mkfifoat
sys_mknodat - mknodat i:isii __syscall_mknodat
-sys_openat - openat i:isii __syscall_openat
-sys_readlinkat - readlinkat i:issi __syscall_readlinkat
-sys_renameat - renameat i:isis __syscall_renameat
-sys_symlinkat - symlinkat i:sis __syscall_symlinkat
-sys_unlinkat - unlinkat i:isi __syscall_unlinkat
-sys_shm_open - shm_open i:sii __syscall_shm_open
-sys_shm_unlink - shm_unlink i:s __syscall_shm_unlink
+sys_openat - openat i:isii __syscall_openat !__openat_nocancel !__openat64_nocancel
+readlinkat - readlinkat i:issi readlinkat
+renameat - renameat i:isis renameat
+symlinkat - symlinkat i:sis symlinkat
+unlinkat - unlinkat i:isi unlinkat
+shm_open - shm_open i:sii shm_open
+shm_unlink - shm_unlink i:s shm_unlink
readlink - readlink i:spi __syscall_readlink __readlink readlink
-sys_pselect - pselect i:iPPPPP __syscall_pselect
+pselect - pselect Ci:iPPPPP __pselect !__libc_pselect pselect
Modified: trunk/glibc-ports/kfreebsd/testrtsig.h
===================================================================
--- trunk/glibc-ports/kfreebsd/testrtsig.h 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/testrtsig.h 2013-05-14 03:56:40 UTC (rev 4435)
@@ -27,11 +27,5 @@
static int
kernel_has_rtsig (void)
{
-#if __ASSUME_REALTIME_SIGNALS
return 1;
-#else
- if (__kernel_getosreldate () < 700050) /* FreeBSD 7.0 is 700055 */
- return 0;
- return 1;
-#endif
}
Deleted: trunk/glibc-ports/kfreebsd/truncate.c
===================================================================
--- trunk/glibc-ports/kfreebsd/truncate.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/truncate.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,52 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Bruno Haible <bruno at clisp.org>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sysdep.h>
-#include <errno.h>
-
-extern int __syscall_truncate (const char *__file, __off_t __length) __THROW;
-libc_hidden_proto (__syscall_truncate)
-extern int __syscall_freebsd6_truncate (const char *__file, int __unused1,
- __off_t __length) __THROW;
-libc_hidden_proto (__syscall_freebsd6_truncate)
-
-int
-__truncate (const char *file, __off_t length)
-{
- int result;
-
- /* First try the new syscall. */
- result = INLINE_SYSCALL (truncate, 2, file, length);
-
-#ifndef __ASSUME_TRUNCATE_SYSCALL
- if (result == -1 && errno == ENOSYS)
- /* New syscall not available, us the old one. */
- result = INLINE_SYSCALL (freebsd6_truncate, 3, file, 0, length);
-#endif
-
- return result;
-}
-
-weak_alias (__truncate, truncate)
-
-/* 'truncate64' is the same as 'truncate', because __off64_t == __off_t. */
-strong_alias (__truncate, __truncate64)
-weak_alias (__truncate64, truncate64)
Deleted: trunk/glibc-ports/kfreebsd/unlinkat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/unlinkat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/unlinkat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -1,135 +0,0 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysdep.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-#include <sys/user.h>
-#include <kernel-features.h>
-
-extern int __syscall_unlinkat (int fd, const char *file, int flag);
-libc_hidden_proto (__syscall_unlinkat)
-
-libc_hidden_proto (__unlink)
-
-/* Remove the link named NAME. */
-int
-unlinkat (fd, file, flag)
- int fd;
- const char *file;
- int flag;
-{
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result = INLINE_SYSCALL (unlinkat, 3, fd, file, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_REMOVEDIR)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
- if (flag & AT_REMOVEDIR)
- return __rmdir (file);
- else
- return __unlink (file);
-#endif
-}
Modified: trunk/glibc-ports/kfreebsd/xmknodat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/xmknodat.c 2013-05-13 18:44:26 UTC (rev 4434)
+++ trunk/glibc-ports/kfreebsd/xmknodat.c 2013-05-14 03:56:40 UTC (rev 4435)
@@ -49,97 +49,12 @@
return -1;
}
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- int result;
-
/* The FreeBSD mknod() system call cannot be used to create FIFOs; we
must use the mkfifo() system call for this purpose. */
if (S_ISFIFO (mode))
- result = INLINE_SYSCALL (mkfifoat, 3, fd, file, mode);
+ return INLINE_SYSCALL (mkfifoat, 3, fd, file, mode);
else
- result = INLINE_SYSCALL (mknodat, 4, fd, file, mode, *dev);
-
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-
-#ifndef __ASSUME_ATFCTS
- if (fd != AT_FDCWD && file[0] != '/')
- {
- int mib[4];
- size_t kf_len = 0;
- char *kf_buf, *kf_bufp;
- size_t filelen;
-
- if (fd < 0)
- {
- __set_errno (EBADF);
- return -1;
- }
-
- filelen = strlen (file);
- if (__builtin_expect (filelen == 0, 0))
- {
- __set_errno (ENOENT);
- return -1;
- }
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_FILEDESC;
- mib[3] = __getpid ();
-
- if (__sysctl (mib, 4, NULL, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_buf = alloca (kf_len + filelen);
- if (__sysctl (mib, 4, kf_buf, &kf_len, NULL, 0) != 0)
- {
- __set_errno (ENOSYS);
- return -1;
- }
-
- kf_bufp = kf_buf;
- while (kf_bufp < kf_buf + kf_len)
- {
- struct kinfo_file *kf = (struct kinfo_file *) (uintptr_t) kf_bufp;
-
- if (kf->kf_fd == fd)
- {
- if (kf->kf_type != KF_TYPE_VNODE ||
- kf->kf_vnode_type != KF_VTYPE_VDIR)
- {
- __set_errno (ENOTDIR);
- return -1;
- }
-
- strcat (kf->kf_path, "/");
- strcat (kf->kf_path, file);
- file = kf->kf_path;
- break;
- }
- kf_bufp += kf->kf_structsize;
- }
-
- if (kf_bufp >= kf_buf + kf_len)
- {
- __set_errno (EBADF);
- return -1;
- }
- }
-
- return __xmknod (vers, file, mode, dev);
-#endif
+ return INLINE_SYSCALL (mknodat, 4, fd, file, mode, *dev);
}
libc_hidden_def (__xmknodat)
More information about the Glibc-bsd-commits
mailing list