diff options
Diffstat (limited to 'usr/src/lib/libc')
43 files changed, 487 insertions, 1498 deletions
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index 85527634fb..856a8c1b91 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -168,7 +168,6 @@ COMSYSOBJS= \ _so_socket.o \ _so_socketpair.o \ _sockconfig.o \ - access.o \ acct.o \ acl.o \ adjtime.o \ @@ -176,23 +175,17 @@ COMSYSOBJS= \ brk.o \ chdir.o \ chmod.o \ - chown.o \ chroot.o \ cladm.o \ close.o \ - creat.o \ - dup.o \ execve.o \ exit.o \ facl.o \ fchdir.o \ fchmod.o \ - fchown.o \ fchroot.o \ - fcntl.o \ fdsync.o \ fpathconf.o \ - fstat.o \ fstatfs.o \ fstatvfs.o \ getcpuid.o \ @@ -214,11 +207,9 @@ COMSYSOBJS= \ ioctl.o \ kaio.o \ kill.o \ - lchown.o \ link.o \ llseek.o \ lseek.o \ - lstat.o \ mmapobjsys.o \ memcntl.o \ mincore.o \ @@ -232,7 +223,6 @@ COMSYSOBJS= \ nice.o \ ntp_adjtime.o \ ntp_gettime.o \ - open.o \ p_online.o \ pathconf.o \ pause.o \ @@ -249,9 +239,7 @@ COMSYSOBJS= \ read.o \ readlink.o \ readv.o \ - rename.o \ resolvepath.o \ - rmdir.o \ seteguid.o \ setgid.o \ setgroups.o \ @@ -263,7 +251,6 @@ COMSYSOBJS= \ sigprocmsk.o \ sigsendset.o \ sigsuspend.o \ - stat.o \ statfs.o \ statvfs.o \ stty.o \ @@ -277,7 +264,6 @@ COMSYSOBJS= \ ulimit.o \ umask.o \ umount2.o \ - unlink.o \ utssys.o \ uucopy.o \ vhangup.o \ @@ -295,11 +281,9 @@ SYSOBJS= \ door.o \ forkx.o \ forkallx.o \ - fxstat.o \ getcontext.o \ gettimeofday.o \ lwp_private.o \ - lxstat.o \ nuname.o \ pipe.o \ syscall.o \ @@ -308,9 +292,7 @@ SYSOBJS= \ uadmin.o \ umount.o \ uname.o \ - vforkx.o \ - xmknod.o \ - xstat.o + vforkx.o # Preserved solely to ease maintenance of 32-bit and 64-bit library builds # This macro should ALWAYS be empty; native APIs are already 'large file'. @@ -384,7 +366,7 @@ PORTGEN= \ dirname.o \ div.o \ drand48.o \ - dup2.o \ + dup.o \ env_data.o \ err.o \ errno.o \ @@ -786,23 +768,22 @@ PORTSYS64= PORTSYS= \ _autofssys.o \ + access.o \ acctctl.o \ bsd_signal.o \ + chown.o \ corectl.o \ exacctsys.o \ execl.o \ execle.o \ execv.o \ - fsmisc.o \ - fstatat.o \ + fcntl.o \ getpagesizes.o \ getpeerucred.o \ inst_sync.o \ issetugid.o \ label.o \ - libc_fcntl.o \ libc_link.o \ - libc_open.o \ lockf.o \ lwp.o \ lwp_cond.o \ @@ -811,12 +792,13 @@ PORTSYS= \ meminfosys.o \ msgsys.o \ nfssys.o \ - openat.o \ + open.o \ pgrpsys.o \ posix_sigwait.o \ ppriv.o \ psetsys.o \ rctlsys.o \ + rename.o \ sbrk.o \ semsys.o \ set_errno.o \ @@ -827,10 +809,12 @@ PORTSYS= \ signal.o \ sigpending.o \ sigstack.o \ + stat.o \ tasksys.o \ time.o \ time_util.o \ ucontext.o \ + unlink.o \ ustat.o \ utimesys.o \ zone.o @@ -935,6 +919,11 @@ CPPFLAGS= -D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \ ASFLAGS= $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \ $(amd64_AS_XARCH) +# As a favor to the dtrace syscall provider, libc still calls the +# old syscall traps that have been obsoleted by the *at() interfaces. +# Delete this to compile libc using only the new *at() system call traps +CPPFLAGS += -D_RETAIN_OLD_SYSCALLS + # Conditionally add support for making |wordexp()| check whether # /usr/bin/ksh is ksh93 or not include ../../../Makefile.ksh93switch diff --git a/usr/src/lib/libc/amd64/crt/_rtld.c b/usr/src/lib/libc/amd64/crt/_rtld.c deleted file mode 100644 index 55d209a4fd..0000000000 --- a/usr/src/lib/libc/amd64/crt/_rtld.c +++ /dev/null @@ -1,330 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Redirection ld.so. Based on the 4.x binary compatibility ld.so, used - * to redirect aliases for ld.so to the real one. - */ - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Import data structures - */ -#include <sys/types.h> -#include <sys/mman.h> -#include <sys/fcntl.h> -#include <sys/stat.h> -#include <sys/sysconfig.h> -#include <sys/auxv.h> -#include <elf.h> -#include <link.h> -#include <string.h> -#include "alias_boot.h" - -/* - * Local manifest constants and macros. - */ -#define ALIGN(x, a) ((int)(x) & ~((int)(a) - 1)) -#define ROUND(x, a) (((int)(x) + ((int)(a) - 1)) & \ - ~((int)(a) - 1)) - -#define EMPTY strings[EMPTY_S] -#define LDSO strings[LDSO_S] -#define ZERO strings[ZERO_S] -#define CLOSE (*(funcs[CLOSE_F])) -#define FSTAT (*(funcs[FSTAT_F])) -#define MMAP (*(funcs[MMAP_F])) -#define MUNMAP (*(funcs[MUNMAP_F])) -#define OPEN (*(funcs[OPEN_F])) -#define PANIC (*(funcs[PANIC_F])) -#define SYSCONFIG (*(funcs[SYSCONFIG_F])) - -#include <link.h> - -/* - * Alias ld.so entry point -- receives a bootstrap structure and a vector - * of strings. The vector is "well-known" to us, and consists of pointers - * to string constants. This aliasing bootstrap requires no relocation in - * order to run, save for the pointers of constant strings. This second - * parameter provides this. Note that this program is carefully coded in - * order to maintain the "no bootstrapping" requirement -- it calls only - * local functions, uses no intrinsics, etc. - */ -void * -__rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) -{ - int i, j, p; /* working */ - int page_size = 0; /* size of a page */ - const char *program_name = EMPTY; /* our name */ - int ldfd; /* fd assigned to ld.so */ - int dzfd = 0; /* fd assigned to /dev/zero */ - Elf32_Ehdr *ehdr; /* ELF header of ld.so */ - Elf32_Phdr *phdr; /* first Phdr in file */ - Elf32_Phdr *pptr; /* working Phdr */ - Elf32_Phdr *lph; /* last loadable Phdr */ - Elf32_Phdr *fph = 0; /* first loadable Phdr */ - caddr_t maddr; /* pointer to mapping claim */ - Elf32_Off mlen; /* total mapping claim */ - caddr_t faddr; /* first program mapping of ld.so */ - Elf32_Off foff; /* file offset for segment mapping */ - Elf32_Off flen; /* file length for segment mapping */ - caddr_t addr; /* working mapping address */ - caddr_t zaddr; /* /dev/zero working mapping addr */ - struct stat sb; /* stat buffer for sizing */ - auxv_t *ap; /* working aux pointer */ - - /* - * Discover things about our environment: auxiliary vector (if - * any), arguments, program name, and the like. - */ - while (ebp->eb_tag != NULL) { - switch (ebp->eb_tag) { - case EB_ARGV: - program_name = *((char **)ebp->eb_un.eb_ptr); - break; - case EB_AUXV: - for (ap = (auxv_t *)ebp->eb_un.eb_ptr; - ap->a_type != AT_NULL; ap++) - if (ap->a_type == AT_PAGESZ) { - page_size = ap->a_un.a_val; - break; - } - break; - } - ebp++; - } - - /* - * If we didn't get a page size from looking in the auxiliary - * vector, we need to get one now. - */ - if (page_size == 0) { - page_size = SYSCONFIG(_CONFIG_PAGESIZE); - ebp->eb_tag = EB_PAGESIZE, (ebp++)->eb_un.eb_val = - (Elf32_Word)page_size; - } - - /* - * Map in the real ld.so. Note that we're mapping it as - * an ELF database, not as a program -- we just want to walk it's - * data structures. Further mappings will actually establish the - * program in the address space. - */ - if ((ldfd = OPEN(LDSO, O_RDONLY)) == -1) - PANIC(program_name); -/* NEEDSWORK (temp kludge to use xstat so we can run on G6) */ - if (FSTAT(2, ldfd, &sb) == -1) - PANIC(program_name); - ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC, - MAP_SHARED, ldfd, 0); - if (ehdr == (Elf32_Ehdr *)-1) - PANIC(program_name); - - /* - * Validate the file we're looking at, ensure it has the correct - * ELF structures, such as: ELF magic numbers, coded for 386, - * is a ".so", etc. - */ - if (ehdr->e_ident[EI_MAG0] != ELFMAG0 || - ehdr->e_ident[EI_MAG1] != ELFMAG1 || - ehdr->e_ident[EI_MAG2] != ELFMAG2 || - ehdr->e_ident[EI_MAG3] != ELFMAG3) - PANIC(program_name); - if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 || - ehdr->e_ident[EI_DATA] != ELFDATA2LSB) - PANIC(program_name); - if (ehdr->e_type != ET_DYN) - PANIC(program_name); - if (ehdr->e_machine != EM_386) - PANIC(program_name); - if (ehdr->e_version > EV_CURRENT) - PANIC(program_name); - - /* - * Point at program headers and start figuring out what to load. - */ - phdr = (Elf32_Phdr *)((caddr_t)ehdr + ehdr->e_phoff); - for (p = 0, pptr = phdr; p < (int)ehdr->e_phnum; p++, - pptr = (Elf32_Phdr *)((caddr_t)pptr + ehdr->e_phentsize)) - if (pptr->p_type == PT_LOAD) { - if (fph == 0) { - fph = pptr; - } else if (pptr->p_vaddr <= lph->p_vaddr) - PANIC(program_name); - lph = pptr; - } - - /* - * We'd better have at least one loadable segment. - */ - if (fph == 0) - PANIC(program_name); - - /* - * Map enough address space to hold the program (as opposed to the - * file) represented by ld.so. The amount to be assigned is the - * range between the end of the last loadable segment and the - * beginning of the first PLUS the alignment of the first segment. - * mmap() can assign us any page-aligned address, but the relocations - * assume the alignments included in the program header. As an - * optimization, however, let's assume that mmap() will actually - * give us an aligned address -- since if it does, we can save - * an munmap() later on. If it doesn't -- then go try it again. - */ - mlen = ROUND((lph->p_vaddr + lph->p_memsz) - - ALIGN(fph->p_vaddr, page_size), page_size); - maddr = (caddr_t)MMAP(0, mlen, PROT_READ | PROT_EXEC, - MAP_SHARED, ldfd, 0); - if (maddr == (caddr_t)-1) - PANIC(program_name); - faddr = (caddr_t)ROUND(maddr, fph->p_align); - - /* - * Check to see whether alignment skew was really needed. - */ - if (faddr != maddr) { - (void) MUNMAP(maddr, mlen); - mlen = ROUND((lph->p_vaddr + lph->p_memsz) - - ALIGN(fph->p_vaddr, fph->p_align) + fph->p_align, - page_size); - maddr = (caddr_t)MMAP(0, mlen, PROT_READ | PROT_EXEC, - MAP_SHARED, ldfd, 0); - if (maddr == (caddr_t)-1) - PANIC(program_name); - faddr = (caddr_t)ROUND(maddr, fph->p_align); - } - - /* - * We have the address space reserved, so map each loadable segment. - */ - for (p = 0, pptr = phdr; p < (int)ehdr->e_phnum; p++, - pptr = (Elf32_Phdr *)((caddr_t)pptr + ehdr->e_phentsize)) { - - /* - * Skip non-loadable segments or segments that don't occupy - * any memory. - */ - if ((pptr->p_type != PT_LOAD) || (pptr->p_memsz == 0)) - continue; - - /* - * Determine the file offset to which the mapping will - * directed (must be aligned) and how much to map (might - * be more than the file in the case of .bss.) - */ - foff = ALIGN(pptr->p_offset, page_size); - flen = pptr->p_memsz + (pptr->p_offset - foff); - - /* - * Set address of this segment relative to our base. - */ - addr = (caddr_t)ALIGN(faddr + pptr->p_vaddr, page_size); - - /* - * If this is the first program header, record our base - * address for later use. - */ - if (pptr == phdr) { - ebp->eb_tag = EB_LDSO_BASE; - (ebp++)->eb_un.eb_ptr = (Elf32_Addr)addr; - } - - /* - * Unmap anything from the last mapping address to this - * one. - */ - if (addr - maddr) { - (void) MUNMAP(maddr, addr - maddr); - mlen -= addr - maddr; - } - - /* - * Determine the mapping protection from the section - * attributes. - */ - i = 0; - if (pptr->p_flags & PF_R) - i |= PROT_READ; - if (pptr->p_flags & PF_W) - i |= PROT_WRITE; - if (pptr->p_flags & PF_X) - i |= PROT_EXEC; - if ((caddr_t)MMAP((caddr_t)addr, flen, i, - MAP_FIXED | MAP_PRIVATE, ldfd, foff) == (caddr_t)-1) - PANIC(program_name); - - /* - * If the memory occupancy of the segment overflows the - * definition in the file, we need to "zero out" the - * end of the mapping we've established, and if necessary, - * map some more space from /dev/zero. - */ - if (pptr->p_memsz > pptr->p_filesz) { - foff = (int)faddr + pptr->p_vaddr + pptr->p_filesz; - zaddr = (caddr_t)ROUND(foff, page_size); - for (j = 0; j < (int)(zaddr - foff); j++) - *((char *)foff + j) = 0; - j = (faddr + pptr->p_vaddr + pptr->p_memsz) - zaddr; - if (j > 0) { - if (dzfd == 0) { - dzfd = OPEN(ZERO, O_RDWR); - if (dzfd == -1) - PANIC(program_name); - } - if ((caddr_t)MMAP((caddr_t)zaddr, j, i, - MAP_FIXED | MAP_PRIVATE, dzfd, - 0) == (caddr_t)-1) - PANIC(program_name); - } - } - - /* - * Update the mapping claim pointer. - */ - maddr = addr + ROUND(flen, page_size); - mlen -= maddr - addr; - } - - /* - * Unmap any final reservation. - */ - if (mlen > 0) - (void) MUNMAP(maddr, mlen); - - /* - * Clean up file descriptor space we've consumed. Pass along - * the /dev/zero file descriptor we got -- every cycle counts. - */ - (void) CLOSE(ldfd); - if (dzfd != 0) - ebp->eb_tag = EB_DEVZERO, (ebp++)->eb_un.eb_val = dzfd; - - ebp->eb_tag = EB_NULL, ebp->eb_un.eb_val = 0; - - /* The two bytes before _rt_boot is for the alias entry point */ - return (void *) (ehdr->e_entry + faddr - 2); -} diff --git a/usr/src/lib/libc/amd64/crt/alias_boot.h b/usr/src/lib/libc/amd64/crt/alias_boot.h deleted file mode 100644 index 5b12462808..0000000000 --- a/usr/src/lib/libc/amd64/crt/alias_boot.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _ALIAS_BOOT_H -#define _ALIAS_BOOT_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * Offsets for string constants used in alias bootstrap. - */ -#define LDSO_S 0 /* "/usr/lib/ld.so.n" */ -#define ZERO_S 1 /* "/dev/zero" */ -#define EMPTY_S 2 /* "(null)" */ -#define S_MAX 3 /* count of strings */ - -/* - * Offsets for function pointers used in alias bootstrap. - */ -#define PANIC_F 0 /* panic() */ -#define OPEN_F 1 /* open() */ -#define MMAP_F 2 /* mmap() */ -#define FSTAT_F 3 /* fstat() */ -#define SYSCONFIG_F 4 /* sysconfig() */ -#define CLOSE_F 5 /* close() */ -#define MUNMAP_F 6 /* munmap() */ -#define F_MAX 7 /* count of functions */ - -#endif /* _ALIAS_BOOT_H */ diff --git a/usr/src/lib/libc/common/sys/access.s b/usr/src/lib/libc/common/sys/access.s deleted file mode 100644 index e39e7e549c..0000000000 --- a/usr/src/lib/libc/common/sys/access.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "access.s" - -/* C library -- access */ -/* int access(char *path, int amode) */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(access,function) - -#include "SYS.h" - - SYSCALL_RVAL1(access) - RET - SET_SIZE(access) diff --git a/usr/src/lib/libc/common/sys/chown.s b/usr/src/lib/libc/common/sys/chown.s deleted file mode 100644 index d77e23b346..0000000000 --- a/usr/src/lib/libc/common/sys/chown.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "chown.s" - -/* C library -- chown */ -/* int chown(char *path, uid_t owner, gid_t group) */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(chown,function) - -#include "SYS.h" - - SYSCALL_RVAL1(chown) - RETC - SET_SIZE(chown) diff --git a/usr/src/lib/libc/common/sys/dup.s b/usr/src/lib/libc/common/sys/dup.s deleted file mode 100644 index 84b89d0170..0000000000 --- a/usr/src/lib/libc/common/sys/dup.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "dup.s" - -/* C library -- dup */ -/* int dup(int fildes) */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(dup,function) - -#include "SYS.h" - - SYSCALL_RVAL1(dup) - RET - SET_SIZE(dup) diff --git a/usr/src/lib/libc/common/sys/fchown.s b/usr/src/lib/libc/common/sys/fchown.s deleted file mode 100644 index 2cc7d35093..0000000000 --- a/usr/src/lib/libc/common/sys/fchown.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "fchown.s" - -/* C library -- fchown */ -/* int fchown(int fildes, uid_t owner, gid_t group) */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(fchown,function) - -#include "SYS.h" - - SYSCALL_RVAL1(fchown) - RETC - SET_SIZE(fchown) diff --git a/usr/src/lib/libc/common/sys/fcntl.s b/usr/src/lib/libc/common/sys/fcntl.s deleted file mode 100644 index 3e44b4546d..0000000000 --- a/usr/src/lib/libc/common/sys/fcntl.s +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "fcntl.s" - -/* - * int __fcntl_syscall(int fildes, int cmd [, arg]) - */ - -#include "SYS.h" - - SYSCALL2_RESTART_RVAL1(__fcntl_syscall,fcntl) - RET - SET_SIZE(__fcntl_syscall) diff --git a/usr/src/lib/libc/common/sys/fstat.s b/usr/src/lib/libc/common/sys/fstat.s deleted file mode 100644 index 54a8e83558..0000000000 --- a/usr/src/lib/libc/common/sys/fstat.s +++ /dev/null @@ -1,60 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "fstat.s" - -/* C library -- fstat */ -/* int fstat (int fildes, struct stat *buf) */ - -#include <sys/asm_linkage.h> - -#if !defined(_LARGEFILE_SOURCE) - ANSI_PRAGMA_WEAK(fstat,function) -#else - ANSI_PRAGMA_WEAK(fstat64,function) -#endif - -#include "SYS.h" - -#if !defined(_LARGEFILE_SOURCE) - - SYSCALL_RVAL1(fstat) - RETC - SET_SIZE(fstat) - -#else - -/* C library -- fstat64 transitional large file API */ -/* int fstat64 (int fildes, struct stat64 *buf) */ - - SYSCALL_RVAL1(fstat64) - RETC - SET_SIZE(fstat64) - -#endif diff --git a/usr/src/lib/libc/common/sys/lchown.s b/usr/src/lib/libc/common/sys/lchown.s deleted file mode 100644 index 5055f53ff4..0000000000 --- a/usr/src/lib/libc/common/sys/lchown.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "lchown.s" - -/* C library -- lchown */ -/* int lchown(const char *path, uid_t owner, gid_t group) */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(lchown,function) - -#include "SYS.h" - - SYSCALL_RVAL1(lchown) - RETC - SET_SIZE(lchown) diff --git a/usr/src/lib/libc/common/sys/lstat.s b/usr/src/lib/libc/common/sys/lstat.s deleted file mode 100644 index fa5c0fdc36..0000000000 --- a/usr/src/lib/libc/common/sys/lstat.s +++ /dev/null @@ -1,60 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "lstat.s" - -/* C library -- lstat */ -/* error = lstat(const char *path, struct lstat *buf) */ - -#include <sys/asm_linkage.h> - -#if !defined(_LARGEFILE_SOURCE) - ANSI_PRAGMA_WEAK(lstat,function) -#else - ANSI_PRAGMA_WEAK(lstat64,function) -#endif - -#include "SYS.h" - -#if !defined(_LARGEFILE_SOURCE) - - SYSCALL_RVAL1(lstat) - RETC - SET_SIZE(lstat) - -#else - -/* C library -- lstat64 - transitional large file API */ -/* error = lstat64(const char *path, struct stat64 *buf) */ - - SYSCALL_RVAL1(lstat64) - RETC - SET_SIZE(lstat64) - -#endif diff --git a/usr/src/lib/libc/common/sys/open.s b/usr/src/lib/libc/common/sys/open.s deleted file mode 100644 index 90c375629b..0000000000 --- a/usr/src/lib/libc/common/sys/open.s +++ /dev/null @@ -1,52 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "open.s" - -#include "SYS.h" - -#if !defined(_LARGEFILE_SOURCE) -/* C library -- open */ -/* int open (const char *path, int oflag, [ mode_t mode ] ) */ - - SYSCALL2_RVAL1(__open_syscall,open) - RET - SET_SIZE(__open_syscall) - -#else -/* - * C library -- open64 - transitional API - * int open64 (const char *path, int oflag, [ mode_t mode ] ) - */ - - SYSCALL2_RVAL1(__open64_syscall,open64) - RET - SET_SIZE(__open64_syscall) - -#endif diff --git a/usr/src/lib/libc/common/sys/rename.s b/usr/src/lib/libc/common/sys/rename.s deleted file mode 100644 index b76767a976..0000000000 --- a/usr/src/lib/libc/common/sys/rename.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "rename.s" - -/* C library -- rename */ -/* int rename(const char *old, const char *new); */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(rename,function) - -#include "SYS.h" - - SYSCALL_RVAL1(rename) - RETC - SET_SIZE(rename) diff --git a/usr/src/lib/libc/common/sys/rmdir.s b/usr/src/lib/libc/common/sys/rmdir.s deleted file mode 100644 index 9e0aeda3d7..0000000000 --- a/usr/src/lib/libc/common/sys/rmdir.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "rmdir.s" - -/* C library -- rmdir */ -/* int rmdir (const char *path); */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(rmdir,function) - -#include "SYS.h" - - SYSCALL_RVAL1(rmdir) - RET - SET_SIZE(rmdir) diff --git a/usr/src/lib/libc/common/sys/stat.s b/usr/src/lib/libc/common/sys/stat.s deleted file mode 100644 index db60595cf6..0000000000 --- a/usr/src/lib/libc/common/sys/stat.s +++ /dev/null @@ -1,60 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "stat.s" - -/* C library -- stat */ -/* int stat (const char *path, struct stat *buf); */ - -#include <sys/asm_linkage.h> - -#if !defined(_LARGEFILE_SOURCE) - ANSI_PRAGMA_WEAK(stat,function) -#else - ANSI_PRAGMA_WEAK(stat64,function) -#endif - -#include "SYS.h" - -#if !defined(_LARGEFILE_SOURCE) - - SYSCALL_RVAL1(stat) - RETC - SET_SIZE(stat) - -#else - -/* C library -- stat64 - transitional API */ -/* int stat64 (const char *path, struct stat64 *buf); */ - - SYSCALL_RVAL1(stat64) - RETC - SET_SIZE(stat64) - -#endif diff --git a/usr/src/lib/libc/common/sys/unlink.s b/usr/src/lib/libc/common/sys/unlink.s deleted file mode 100644 index 427ed54c15..0000000000 --- a/usr/src/lib/libc/common/sys/unlink.s +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "unlink.s" - -/* C library -- unlink */ -/* int unlink (const char *path); */ - -#include <sys/asm_linkage.h> - - ANSI_PRAGMA_WEAK(unlink,function) - -#include "SYS.h" - - SYSCALL_RVAL1(unlink) - RETC - SET_SIZE(unlink) diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index b4e26c8f67..cf40cf18d2 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -145,19 +145,14 @@ GENOBJS= \ # sysobjs that contain large-file interfaces COMSYSOBJS64= \ - creat64.o \ - fstat64.o \ fstatvfs64.o \ getdents64.o \ getrlimit64.o \ lseek64.o \ - lstat64.o \ mmap64.o \ - open64.o \ pread64.o \ pwrite64.o \ setrlimit64.o \ - stat64.o \ statvfs64.o SYSOBJS64= @@ -194,7 +189,6 @@ COMSYSOBJS= \ _so_socket.o \ _so_socketpair.o \ _sockconfig.o \ - access.o \ acct.o \ acl.o \ adjtime.o \ @@ -202,23 +196,17 @@ COMSYSOBJS= \ brk.o \ chdir.o \ chmod.o \ - chown.o \ chroot.o \ cladm.o \ close.o \ - creat.o \ - dup.o \ execve.o \ exit.o \ facl.o \ fchdir.o \ fchmod.o \ - fchown.o \ fchroot.o \ - fcntl.o \ fdsync.o \ fpathconf.o \ - fstat.o \ fstatfs.o \ fstatvfs.o \ getcpuid.o \ @@ -240,11 +228,9 @@ COMSYSOBJS= \ ioctl.o \ kaio.o \ kill.o \ - lchown.o \ link.o \ llseek.o \ lseek.o \ - lstat.o \ mmapobjsys.o \ memcntl.o \ mincore.o \ @@ -258,7 +244,6 @@ COMSYSOBJS= \ nice.o \ ntp_adjtime.o \ ntp_gettime.o \ - open.o \ p_online.o \ pathconf.o \ pause.o \ @@ -275,9 +260,7 @@ COMSYSOBJS= \ read.o \ readlink.o \ readv.o \ - rename.o \ resolvepath.o \ - rmdir.o \ seteguid.o \ setgid.o \ setgroups.o \ @@ -289,7 +272,6 @@ COMSYSOBJS= \ sigprocmsk.o \ sigsendset.o \ sigsuspend.o \ - stat.o \ statfs.o \ statvfs.o \ stty.o \ @@ -303,7 +285,6 @@ COMSYSOBJS= \ ulimit.o \ umask.o \ umount2.o \ - unlink.o \ utssys.o \ uucopy.o \ vhangup.o \ @@ -321,11 +302,9 @@ SYSOBJS= \ door.o \ forkx.o \ forkallx.o \ - fxstat.o \ getcontext.o \ gettimeofday.o \ lwp_private.o \ - lxstat.o \ nuname.o \ pipe.o \ ptrace.o \ @@ -336,7 +315,6 @@ SYSOBJS= \ umount.o \ uname.o \ vforkx.o \ - xmknod.o \ xstat.o # objects under ../port which contain transitional large file interfaces @@ -418,7 +396,7 @@ PORTGEN= \ dirname.o \ div.o \ drand48.o \ - dup2.o \ + dup.o \ env_data.o \ err.o \ errno.o \ @@ -822,29 +800,27 @@ UNWINDASMOBJS= \ # objects that implement the transitional large file API PORTSYS64= \ - fstatat64.o \ lockf64.o \ - openat64.o + stat64.o PORTSYS= \ _autofssys.o \ + access.o \ acctctl.o \ bsd_signal.o \ + chown.o \ corectl.o \ exacctsys.o \ execl.o \ execle.o \ execv.o \ - fsmisc.o \ - fstatat.o \ + fcntl.o \ getpagesizes.o \ getpeerucred.o \ inst_sync.o \ issetugid.o \ label.o \ - libc_fcntl.o \ libc_link.o \ - libc_open.o \ lockf.o \ lwp.o \ lwp_cond.o \ @@ -853,12 +829,13 @@ PORTSYS= \ meminfosys.o \ msgsys.o \ nfssys.o \ - openat.o \ + open.o \ pgrpsys.o \ posix_sigwait.o \ ppriv.o \ psetsys.o \ rctlsys.o \ + rename.o \ sbrk.o \ semsys.o \ set_errno.o \ @@ -869,10 +846,12 @@ PORTSYS= \ signal.o \ sigpending.o \ sigstack.o \ + stat.o \ tasksys.o \ time.o \ time_util.o \ ucontext.o \ + unlink.o \ ustat.o \ utimesys.o \ zone.o @@ -985,6 +964,11 @@ CPPFLAGS= -D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \ -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) ASFLAGS= $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH) +# As a favor to the dtrace syscall provider, libc still calls the +# old syscall traps that have been obsoleted by the *at() interfaces. +# Delete this to compile libc using only the new *at() system call traps +CPPFLAGS += -D_RETAIN_OLD_SYSCALLS + # Conditionally add support for making |wordexp()| check whether # /usr/bin/ksh is ksh93 or not include ../../../Makefile.ksh93switch diff --git a/usr/src/lib/libc/i386/crt/_rtboot.s b/usr/src/lib/libc/i386/crt/_rtboot.s index e21c5cb956..fa928906e9 100644 --- a/usr/src/lib/libc/i386/crt/_rtboot.s +++ b/usr/src/lib/libc/i386/crt/_rtboot.s @@ -18,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -112,11 +113,11 @@ __rtboot: pushl %eax leal f.SYSCONFIG - .L01(%ebx),%eax pushl %eax - leal f.FSTAT - .L01(%ebx),%eax + leal f.FSTATAT - .L01(%ebx),%eax pushl %eax leal f.MMAP - .L01(%ebx),%eax pushl %eax - leal f.OPEN - .L01(%ebx),%eax + leal f.OPENAT - .L01(%ebx),%eax pushl %eax leal f.PANIC - .L01(%ebx),%eax pushl %eax @@ -151,8 +152,8 @@ f.PANIC: jmp f.EXIT / Not reached -f.OPEN: - movl $SYS_open,%eax +f.OPENAT: + movl $SYS_openat,%eax jmp __syscall f.MMAP: movl $SYS_mmap,%eax @@ -172,8 +173,8 @@ f.LSEEK: f.CLOSE: movl $SYS_close,%eax jmp __syscall -f.FSTAT: - movl $SYS_fxstat,%eax / NEEDSWORK: temp kludge for G6 +f.FSTATAT: + movl $SYS_fstatat,%eax jmp __syscall f.SYSCONFIG: movl $SYS_sysconfig,%eax diff --git a/usr/src/lib/libc/i386/crt/_rtld.c b/usr/src/lib/libc/i386/crt/_rtld.c index d7eaa323b8..92c9e53c55 100644 --- a/usr/src/lib/libc/i386/crt/_rtld.c +++ b/usr/src/lib/libc/i386/crt/_rtld.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,16 +18,15 @@ * * CDDL HEADER END */ -#pragma ident "%Z%%M% %I% %E% SMI" /* - * Redirection ld.so. Based on the 4.x binary compatibility ld.so, used - * to redirect aliases for ld.so to the real one. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ /* - * Copyright (c) 1990, 1991, 2001 by Sun Microsystems, Inc. - * All rights reserved. + * Redirection ld.so. Based on the 4.x binary compatibility ld.so, used + * to redirect aliases for ld.so to the real one. */ /* @@ -56,10 +54,10 @@ #define LDSO strings[LDSO_S] #define ZERO strings[ZERO_S] #define CLOSE (*(funcs[CLOSE_F])) -#define FSTAT (*(funcs[FSTAT_F])) +#define FSTATAT (*(funcs[FSTATAT_F])) #define MMAP (*(funcs[MMAP_F])) #define MUNMAP (*(funcs[MUNMAP_F])) -#define OPEN (*(funcs[OPEN_F])) +#define OPENAT (*(funcs[OPENAT_F])) #define PANIC (*(funcs[PANIC_F])) #define SYSCONFIG (*(funcs[SYSCONFIG_F])) @@ -134,10 +132,9 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) * data structures. Further mappings will actually establish the * program in the address space. */ - if ((ldfd = OPEN(LDSO, O_RDONLY)) == -1) + if ((ldfd = OPENAT(AT_FDCWD, LDSO, O_RDONLY)) == -1) PANIC(program_name); -/* NEEDSWORK (temp kludge to use xstat so we can run on G6) */ - if (FSTAT(2, ldfd, &sb) == -1) + if (FSTATAT(ldfd, NULL, &sb, 0) == -1) PANIC(program_name); ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC, MAP_SHARED, ldfd, 0); @@ -291,7 +288,7 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) j = (faddr + pptr->p_vaddr + pptr->p_memsz) - zaddr; if (j > 0) { if (dzfd == 0) { - dzfd = OPEN(ZERO, O_RDWR); + dzfd = OPENAT(AT_FDCWD, ZERO, O_RDWR); if (dzfd == -1) PANIC(program_name); } diff --git a/usr/src/lib/libc/i386/crt/alias_boot.h b/usr/src/lib/libc/i386/crt/alias_boot.h index d6828f6fc8..e2a96f933a 100644 --- a/usr/src/lib/libc/i386/crt/alias_boot.h +++ b/usr/src/lib/libc/i386/crt/alias_boot.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,15 +18,15 @@ * * CDDL HEADER END */ + /* - * Copyright (c) 1991 Sun Microsystems, Inc. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #ifndef _ALIAS_BOOT_H #define _ALIAS_BOOT_H -#ident "%W% %E% SMI" - /* * Offsets for string constants used in alias bootstrap. */ @@ -40,9 +39,9 @@ * Offsets for function pointers used in alias bootstrap. */ #define PANIC_F 0 /* panic() */ -#define OPEN_F 1 /* open() */ +#define OPENAT_F 1 /* openat() */ #define MMAP_F 2 /* mmap() */ -#define FSTAT_F 3 /* fstat() */ +#define FSTATAT_F 3 /* fstatat() */ #define SYSCONFIG_F 4 /* sysconfig() */ #define CLOSE_F 5 /* close() */ #define MUNMAP_F 6 /* munmap() */ diff --git a/usr/src/lib/libc/i386/sys/fxstat.s b/usr/src/lib/libc/i386/sys/fxstat.s deleted file mode 100644 index da3eb8f5c0..0000000000 --- a/usr/src/lib/libc/i386/sys/fxstat.s +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "fxstat.s" - -#include "SYS.h" - -/ error = _fxstat(file, statbuf); -/ char statbuf[34] - - ENTRY(_fxstat) - SYSTRAP_RVAL1(fxstat) - SYSCERROR - RETC - SET_SIZE(_fxstat) diff --git a/usr/src/lib/libc/i386/sys/lxstat.s b/usr/src/lib/libc/i386/sys/lxstat.s deleted file mode 100644 index 9e9d3af63c..0000000000 --- a/usr/src/lib/libc/i386/sys/lxstat.s +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "lxstat.s" - -/ int -/ _lxstat(_STAT_VER, _path, _buf); - -#include "SYS.h" - - ENTRY(_lxstat) - SYSTRAP_RVAL1(lxstat) - SYSCERROR - RETC - SET_SIZE(_lxstat) diff --git a/usr/src/lib/libc/i386/sys/xmknod.s b/usr/src/lib/libc/i386/sys/xmknod.s deleted file mode 100644 index e8a9421dcc..0000000000 --- a/usr/src/lib/libc/i386/sys/xmknod.s +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "xmknod.s" - -/ OS library -- _xmknod - -/ error = _xmknod(version, string, mode, dev) - -#include "SYS.h" - - ENTRY(_xmknod) - SYSTRAP_RVAL1(xmknod) - SYSCERROR - RETC - SET_SIZE(_xmknod) diff --git a/usr/src/lib/libc/i386/sys/xstat.c b/usr/src/lib/libc/i386/sys/xstat.c new file mode 100644 index 0000000000..69637eccfb --- /dev/null +++ b/usr/src/lib/libc/i386/sys/xstat.c @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Wrapper functions to intercept calls to the obsolete + * _xstat(), _lxstat(), _fxstat() and _xmknod() functions + * and redirect them to the proper direct system calls. + */ + +#include "lint.h" +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> + +int +_xstat(int version, const char *path, struct stat *statb) +{ + if (version != _STAT_VER) { + errno = EINVAL; + return (-1); + } + return (stat(path, statb)); +} + +int +_lxstat(int version, const char *path, struct stat *statb) +{ + if (version != _STAT_VER) { + errno = EINVAL; + return (-1); + } + return (lstat(path, statb)); +} + +int +_fxstat(int version, int fd, struct stat *statb) +{ + if (version != _STAT_VER) { + errno = EINVAL; + return (-1); + } + return (fstat(fd, statb)); +} + +int +_xmknod(int version, const char *path, mode_t mode, dev_t dev) +{ + if (version != _MKNOD_VER) { + errno = EINVAL; + return (-1); + } + return (mknod(path, mode, dev)); +} diff --git a/usr/src/lib/libc/i386/sys/xstat.s b/usr/src/lib/libc/i386/sys/xstat.s deleted file mode 100644 index 8581a5f2af..0000000000 --- a/usr/src/lib/libc/i386/sys/xstat.s +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "xstat.s" - -/ OS library -- _xstat - -/ error = _xstat(version, string, statbuf) - -#include "SYS.h" - - ENTRY(_xstat) - SYSTRAP_RVAL1(xstat) - SYSCERROR - RETC - SET_SIZE(_xstat) diff --git a/usr/src/lib/libc/inc/libc.h b/usr/src/lib/libc/inc/libc.h index 4059d08d8e..5feca8b80f 100644 --- a/usr/src/lib/libc/inc/libc.h +++ b/usr/src/lib/libc/inc/libc.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,8 +32,6 @@ #ifndef _LIBC_H #define _LIBC_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <thread.h> #include <stdio.h> #include <dirent.h> @@ -118,6 +116,13 @@ extern enum fp_direction_type _QgetRD(void); #error Unknown architecture! #endif +/* + * defined in open.c + */ +extern int __open(const char *, int, mode_t); +extern int __open64(const char *, int, mode_t); +extern int __openat(int, const char *, int, mode_t); +extern int __openat64(int, const char *, int, mode_t); /* * defined in hex_bin.c diff --git a/usr/src/lib/libc/inc/thr_uberdata.h b/usr/src/lib/libc/inc/thr_uberdata.h index 4d1272105c..ac14038787 100644 --- a/usr/src/lib/libc/inc/thr_uberdata.h +++ b/usr/src/lib/libc/inc/thr_uberdata.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1354,7 +1354,10 @@ extern void _thrp_unwind(void *); extern pid_t __forkx(int); extern pid_t __forkallx(int); -extern int __open(const char *, int, ...); +extern int __open(const char *, int, mode_t); +extern int __open64(const char *, int, mode_t); +extern int __openat(int, const char *, int, mode_t); +extern int __openat64(int, const char *, int, mode_t); extern int __close(int); extern ssize_t __read(int, void *, size_t); extern ssize_t __write(int, const void *, size_t); diff --git a/usr/src/lib/libc/port/gen/attrat.c b/usr/src/lib/libc/port/gen/attrat.c index 725bdd9b12..89163a3909 100644 --- a/usr/src/lib/libc/port/gen/attrat.c +++ b/usr/src/lib/libc/port/gen/attrat.c @@ -18,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -33,7 +34,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <sys/stat.h> -#include <sys/filio.h> +#include <sys/file.h> #include <unistd.h> #include <dlfcn.h> #include <stdio.h> @@ -47,13 +48,18 @@ static int (*nvlookupint64)(nvlist_t *, const char *, uint64_t *); static mutex_t attrlock = DEFAULTMUTEX; static int initialized; -extern int __openattrdirat(int basefd, const char *name); static char *xattr_view_name[XATTR_VIEW_LAST] = { VIEW_READONLY, VIEW_READWRITE }; +int +__openattrdirat(int fd, const char *name) +{ + return (syscall(SYS_openat, fd, name, FXATTRDIROPEN, 0)); +} + static int attrat_init() { diff --git a/usr/src/lib/libc/port/gen/dup2.c b/usr/src/lib/libc/port/gen/dup.c index 9708d3afb3..8b5db30b19 100644 --- a/usr/src/lib/libc/port/gen/dup2.c +++ b/usr/src/lib/libc/port/gen/dup.c @@ -20,21 +20,25 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - -#pragma weak _dup2 = dup2 - #include "lint.h" #include <sys/types.h> #include <fcntl.h> +#pragma weak _dup = dup +int +dup(int fildes) +{ + return (fcntl(fildes, F_DUPFD, 0)); +} + +#pragma weak _dup2 = dup2 int dup2(int fildes, int fildes2) { diff --git a/usr/src/lib/libc/common/sys/creat.s b/usr/src/lib/libc/port/sys/access.c index a2922eb974..0bf92311b6 100644 --- a/usr/src/lib/libc/common/sys/creat.s +++ b/usr/src/lib/libc/port/sys/access.c @@ -19,32 +19,29 @@ * CDDL HEADER END */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - .file "creat.s" - -#include "SYS.h" - -#if !defined(_LARGEFILE_SOURCE) -/* C library -- creat */ -/* int __creat(char *path, mode_t mode) */ - - SYSCALL2_RVAL1(__creat,creat) - RET - SET_SIZE(__creat) - +#include "lint.h" +#include <unistd.h> +#include <sys/syscall.h> +#include <sys/fcntl.h> + +int +faccessat(int fd, const char *fname, int amode, int flag) +{ + return (syscall(SYS_faccessat, fd, fname, amode, flag)); +} + +#pragma weak _access = access +int +access(const char *fname, int amode) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_access, fname, amode)); #else -/* C library -- creat64 */ -/* int __creat64(char *path, mode_t mode) */ - - SYSCALL2_RVAL1(__creat64,creat64) - RET - SET_SIZE(__creat64) - + return (faccessat(AT_FDCWD, fname, amode, 0)); #endif +} diff --git a/usr/src/lib/libc/port/sys/fsmisc.c b/usr/src/lib/libc/port/sys/chown.c index 5ca207adaf..5ea62e12ce 100644 --- a/usr/src/lib/libc/port/sys/fsmisc.c +++ b/usr/src/lib/libc/port/sys/chown.c @@ -20,44 +20,53 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma weak _fchownat = fchownat -#pragma weak _unlinkat = unlinkat - #include "lint.h" +#include <stdio.h> +#include <unistd.h> #include <sys/types.h> #include <sys/syscall.h> -#include <sys/stat.h> +#include <sys/fcntl.h> +#pragma weak _fchownat = fchownat int fchownat(int fd, const char *name, uid_t uid, gid_t gid, int flags) { - return (syscall(SYS_fsat, 4, fd, name, uid, gid, flags)); -} - -int -unlinkat(int fd, const char *name, int flags) -{ - return (syscall(SYS_fsat, 5, fd, name, flags)); + return (syscall(SYS_fchownat, fd, name, uid, gid, flags)); } +#pragma weak _chown = chown int -renameat(int fromfd, const char *fromname, int tofd, const char *toname) +chown(const char *name, uid_t uid, gid_t gid) { - return (syscall(SYS_fsat, 7, fromfd, fromname, tofd, toname)); +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_chown, name, uid, gid)); +#else + return (fchownat(AT_FDCWD, name, uid, gid, 0)); +#endif } +#pragma weak _lchown = lchown int -faccessat(int fd, const char *fname, int amode, int flag) +lchown(const char *name, uid_t uid, gid_t gid) { - return (syscall(SYS_fsat, 8, fd, fname, amode, flag)); +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_lchown, name, uid, gid)); +#else + return (fchownat(AT_FDCWD, name, uid, gid, AT_SYMLINK_NOFOLLOW)); +#endif } +#pragma weak _fchown = fchown int -__openattrdirat(int fd, const char *name) +fchown(int filedes, uid_t uid, gid_t gid) { - return (syscall(SYS_fsat, 9, fd, name)); +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_fchown, filedes, uid, gid)); +#else + return (fchownat(filedes, NULL, uid, gid, 0)); +#endif } diff --git a/usr/src/lib/libc/port/sys/libc_fcntl.c b/usr/src/lib/libc/port/sys/fcntl.c index beab99f74c..cea7e79dd2 100644 --- a/usr/src/lib/libc/port/sys/libc_fcntl.c +++ b/usr/src/lib/libc/port/sys/fcntl.c @@ -20,15 +20,13 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lint.h" #include <sys/param.h> #include <sys/sockio.h> @@ -52,8 +50,6 @@ #include <stdlib.h> #include "libc.h" -extern int __fcntl_syscall(int fd, int cmd, ...); - #if !defined(_LP64) /* * XXX these hacks are needed for X.25 which assumes that s_fcntl and @@ -92,6 +88,6 @@ __fcntl(int fd, int cmd, ...) return (res); default: - return (__fcntl_syscall(fd, cmd, arg)); + return (syscall(SYS_fcntl, fd, cmd, arg)); } } diff --git a/usr/src/lib/libc/port/sys/libc_open.c b/usr/src/lib/libc/port/sys/open.c index ad9d07d7fd..067bb72d69 100644 --- a/usr/src/lib/libc/port/sys/libc_open.c +++ b/usr/src/lib/libc/port/sys/open.c @@ -20,15 +20,13 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lint.h" #include <sys/mkdev.h> #include <limits.h> @@ -37,72 +35,71 @@ #include <strings.h> #include <errno.h> #include <sys/stat.h> +#include <sys/fcntl.h> #include <sys/stropts.h> #include <sys/stream.h> #include <sys/ptms.h> +#include <sys/syscall.h> #include "libc.h" -#if !defined(_LP64) -extern int __open64_syscall(const char *fname, int oflag, mode_t mode); -#endif - -extern int __open_syscall(const char *fname, int oflag, mode_t mode); - +static int xpg4_fixup(int fd); static void push_module(int fd); static int isptsfd(int fd); static void itoa(int i, char *ptr); int -__open(const char *fname, int oflag, ...) +__openat(int dfd, const char *path, int oflag, mode_t mode) { - mode_t mode; - int fd; - va_list ap; - - va_start(ap, oflag); - mode = va_arg(ap, mode_t); - va_end(ap); - - /* - * XPG4v2 requires that open of a slave pseudo terminal device - * provides the process with an interface that is identical to - * the terminal interface. For a more detailed discussion, - * see bugid 4025044. - */ - fd = __open_syscall(fname, oflag, mode); - if (libc__xpg4 != 0 && fd >= 0 && isptsfd(fd)) - push_module(fd); - return (fd); + int fd = syscall(SYS_openat, dfd, path, oflag, mode); + return (xpg4_fixup(fd)); +} + +int +__open(const char *path, int oflag, mode_t mode) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + int fd = syscall(SYS_open, path, oflag, mode); + return (xpg4_fixup(fd)); +#else + return (__openat(AT_FDCWD, path, oflag, mode)); +#endif } #if !defined(_LP64) + +int +__openat64(int dfd, const char *path, int oflag, mode_t mode) +{ + int fd = syscall(SYS_openat64, dfd, path, oflag, mode); + return (xpg4_fixup(fd)); +} + +int +__open64(const char *path, int oflag, mode_t mode) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + int fd = syscall(SYS_open64, path, oflag, mode); + return (xpg4_fixup(fd)); +#else + return (__openat64(AT_FDCWD, path, oflag, mode)); +#endif +} + +#endif /* !_LP64 */ + /* - * The 32-bit APIs to large files require this interposition. - * The 64-bit APIs just fall back to __open() above. + * XPG4v2 requires that open of a slave pseudo terminal device + * provides the process with an interface that is identical to + * the terminal interface. For a more detailed discussion, + * see bugid 4025044. */ -int -__open64(const char *fname, int oflag, ...) +static int +xpg4_fixup(int fd) { - mode_t mode; - int fd; - va_list ap; - - va_start(ap, oflag); - mode = va_arg(ap, mode_t); - va_end(ap); - - /* - * XPG4v2 requires that open of a slave pseudo terminal device - * provides the process with an interface that is identical to - * the terminal interface. For a more detailed discussion, - * see bugid 4025044. - */ - fd = __open64_syscall(fname, oflag, mode); if (libc__xpg4 != 0 && fd >= 0 && isptsfd(fd)) push_module(fd); return (fd); } -#endif /* !_LP64 */ /* * Check if the file matches an entry in the /dev/pts directory. diff --git a/usr/src/lib/libc/port/sys/fstatat.c b/usr/src/lib/libc/port/sys/rename.c index 15c9d3b0cb..7f321e091c 100644 --- a/usr/src/lib/libc/port/sys/fstatat.c +++ b/usr/src/lib/libc/port/sys/rename.c @@ -20,37 +20,29 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - -#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 -#pragma weak _fstatat64 = fstatat64 -#else -#pragma weak _fstatat = fstatat -#endif - #include "lint.h" -#include <sys/types.h> +#include <stdio.h> +#include <unistd.h> #include <sys/syscall.h> -#include <sys/stat.h> - -#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 +#include <sys/fcntl.h> int -fstatat64(int fd, const char *name, struct stat64 *sb, int flags) +renameat(int oldfd, const char *oldname, int newfd, const char *newname) { - return (syscall(SYS_fsat, 2, fd, name, sb, flags)); + return (syscall(SYS_renameat, oldfd, oldname, newfd, newname)); } -#else - +#pragma weak _rename = rename int -fstatat(int fd, const char *name, struct stat *sb, int flags) +rename(const char *oldname, const char *newname) { - return (syscall(SYS_fsat, 3, fd, name, sb, flags)); -} - +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_rename, oldname, newname)); +#else + return (renameat(AT_FDCWD, oldname, AT_FDCWD, newname)); #endif +} diff --git a/usr/src/lib/libc/port/sys/stat.c b/usr/src/lib/libc/port/sys/stat.c new file mode 100644 index 0000000000..f09c7ed1a8 --- /dev/null +++ b/usr/src/lib/libc/port/sys/stat.c @@ -0,0 +1,117 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "lint.h" +#include <sys/types.h> +#include <sys/syscall.h> +#include <sys/stat.h> +#include <sys/fcntl.h> + +#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 + +#pragma weak _fstatat64 = fstatat64 +int +fstatat64(int fd, const char *name, struct stat64 *sb, int flags) +{ + return (syscall(SYS_fstatat64, fd, name, sb, flags)); +} + +#pragma weak _stat64 = stat64 +int +stat64(const char *name, struct stat64 *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_stat64, name, sb)); +#else + return (fstatat64(AT_FDCWD, name, sb, 0)); +#endif +} + +#pragma weak _lstat64 = lstat64 +int +lstat64(const char *name, struct stat64 *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_lstat64, name, sb)); +#else + return (fstatat64(AT_FDCWD, name, sb, AT_SYMLINK_NOFOLLOW)); +#endif +} + +#pragma weak _fstat64 = fstat64 +int +fstat64(int fd, struct stat64 *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_fstat64, fd, sb)); +#else + return (fstatat64(fd, NULL, sb, 0)); +#endif +} + +#else /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */ + +#pragma weak _fstatat = fstatat +int +fstatat(int fd, const char *name, struct stat *sb, int flags) +{ + return (syscall(SYS_fstatat, fd, name, sb, flags)); +} + +#pragma weak _stat = stat +int +stat(const char *name, struct stat *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_stat, name, sb)); +#else + return (fstatat(AT_FDCWD, name, sb, 0)); +#endif +} + +#pragma weak _lstat = lstat +int +lstat(const char *name, struct stat *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_lstat, name, sb)); +#else + return (fstatat(AT_FDCWD, name, sb, AT_SYMLINK_NOFOLLOW)); +#endif +} + +#pragma weak _fstat = fstat +int +fstat(int fd, struct stat *sb) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_fstat, fd, sb)); +#else + return (fstatat(fd, NULL, sb, 0)); +#endif +} + +#endif /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */ diff --git a/usr/src/lib/libc/port/sys/openat.c b/usr/src/lib/libc/port/sys/unlink.c index 0a15a8746d..209eb4ad56 100644 --- a/usr/src/lib/libc/port/sys/openat.c +++ b/usr/src/lib/libc/port/sys/unlink.c @@ -20,43 +20,40 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lint.h" -#include <stdarg.h> -#include <sys/types.h> +#include <unistd.h> #include <sys/syscall.h> +#include <sys/fcntl.h> -#if !defined(_LP64) && _FILE_OFFSET_BITS == 64 - +#pragma weak _unlinkat = unlinkat int -__openat64(int fd, const char *name, int oflag, ...) +unlinkat(int fd, const char *name, int flags) { - va_list ap; - mode_t mode; - - va_start(ap, oflag); - mode = va_arg(ap, mode_t); - va_end(ap); - return (syscall(SYS_fsat, 1, fd, name, oflag, mode)); + return (syscall(SYS_unlinkat, fd, name, flags)); } -#else - +#pragma weak _unlink = unlink int -__openat(int fd, const char *name, int oflag, ...) +unlink(const char *name) { - va_list ap; - mode_t mode; - - va_start(ap, oflag); - mode = va_arg(ap, mode_t); - va_end(ap); - return (syscall(SYS_fsat, 0, fd, name, oflag, mode)); +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_unlink, name)); +#else + return (unlinkat(AT_FDCWD, name, 0)); +#endif } +#pragma weak _rmdir = rmdir +int +rmdir(const char *name) +{ +#if defined(_RETAIN_OLD_SYSCALLS) + return (syscall(SYS_rmdir, name)); +#else + return (unlinkat(AT_FDCWD, name, AT_REMOVEDIR)); #endif +} diff --git a/usr/src/lib/libc/port/threads/scalls.c b/usr/src/lib/libc/port/threads/scalls.c index 337ed35554..368b864d3f 100644 --- a/usr/src/lib/libc/port/threads/scalls.c +++ b/usr/src/lib/libc/port/threads/scalls.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -727,26 +727,6 @@ close(int fildes) } int -creat(const char *path, mode_t mode) -{ - extern int __creat(const char *, mode_t); - int rv; - - PERFORM(__creat(path, mode)) -} - -#if !defined(_LP64) -int -creat64(const char *path, mode_t mode) -{ - extern int __creat64(const char *, mode_t); - int rv; - - PERFORM(__creat64(path, mode)) -} -#endif /* !_LP64 */ - -int door_call(int d, door_arg_t *params) { extern int __door_call(int, door_arg_t *); @@ -837,9 +817,8 @@ msync(caddr_t addr, size_t len, int flags) } int -open(const char *path, int oflag, ...) +openat(int fd, const char *path, int oflag, ...) { - extern int __open(const char *, int, ...); mode_t mode; int rv; va_list ap; @@ -847,13 +826,12 @@ open(const char *path, int oflag, ...) va_start(ap, oflag); mode = va_arg(ap, mode_t); va_end(ap); - PERFORM(__open(path, oflag, mode)) + PERFORM(__openat(fd, path, oflag, mode)) } int -openat(int fd, const char *path, int oflag, ...) +open(const char *path, int oflag, ...) { - extern int __openat(int, const char *, int, ...); mode_t mode; int rv; va_list ap; @@ -861,14 +839,19 @@ openat(int fd, const char *path, int oflag, ...) va_start(ap, oflag); mode = va_arg(ap, mode_t); va_end(ap); - PERFORM(__openat(fd, path, oflag, mode)) + PERFORM(__open(path, oflag, mode)) +} + +int +creat(const char *path, mode_t mode) +{ + return (open(path, O_WRONLY | O_CREAT | O_TRUNC, mode)); } #if !defined(_LP64) int -open64(const char *path, int oflag, ...) +openat64(int fd, const char *path, int oflag, ...) { - extern int __open64(const char *, int, ...); mode_t mode; int rv; va_list ap; @@ -876,13 +859,12 @@ open64(const char *path, int oflag, ...) va_start(ap, oflag); mode = va_arg(ap, mode_t); va_end(ap); - PERFORM(__open64(path, oflag, mode)) + PERFORM(__openat64(fd, path, oflag, mode)) } int -openat64(int fd, const char *path, int oflag, ...) +open64(const char *path, int oflag, ...) { - extern int __openat64(int, const char *, int, ...); mode_t mode; int rv; va_list ap; @@ -890,7 +872,13 @@ openat64(int fd, const char *path, int oflag, ...) va_start(ap, oflag); mode = va_arg(ap, mode_t); va_end(ap); - PERFORM(__openat64(fd, path, oflag, mode)) + PERFORM(__open64(path, oflag, mode)) +} + +int +creat64(const char *path, mode_t mode) +{ + return (open64(path, O_WRONLY | O_CREAT | O_TRUNC, mode)); } #endif /* !_LP64 */ diff --git a/usr/src/lib/libc/port/threads/spawn.c b/usr/src/lib/libc/port/threads/spawn.c index 8228a25b64..fd91cf44cd 100644 --- a/usr/src/lib/libc/port/threads/spawn.c +++ b/usr/src/lib/libc/port/threads/spawn.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -76,7 +76,6 @@ extern int __sigaction(int, const struct sigaction *, struct sigaction *); #define getdents64 getdents #define dirent64_t dirent_t #else -extern int __open64(const char *, int, ...); extern int getdents64(int, dirent64_t *, size_t); #endif @@ -198,8 +197,7 @@ perform_file_actions(file_attr_t *fap, void *dirbuf) do { switch (fap->fa_type) { case FA_OPEN: - fd = __open(fap->fa_path, - fap->fa_oflag, fap->fa_mode); + fd = __open(fap->fa_path, fap->fa_oflag, fap->fa_mode); if (fd < 0) return (errno); if (fd != fap->fa_filedes) { diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index a7d66be272..67d166fa7c 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -155,19 +155,14 @@ GENOBJS= \ # sysobjs that contain large-file interfaces COMSYSOBJS64= \ - creat64.o \ - fstat64.o \ fstatvfs64.o \ getdents64.o \ getrlimit64.o \ lseek64.o \ - lstat64.o \ mmap64.o \ - open64.o \ pread64.o \ pwrite64.o \ setrlimit64.o \ - stat64.o \ statvfs64.o SYSOBJS64= @@ -204,7 +199,6 @@ COMSYSOBJS= \ _so_socket.o \ _so_socketpair.o \ _sockconfig.o \ - access.o \ acct.o \ acl.o \ adjtime.o \ @@ -212,23 +206,17 @@ COMSYSOBJS= \ brk.o \ chdir.o \ chmod.o \ - chown.o \ chroot.o \ cladm.o \ close.o \ - creat.o \ - dup.o \ execve.o \ exit.o \ facl.o \ fchdir.o \ fchmod.o \ - fchown.o \ fchroot.o \ - fcntl.o \ fdsync.o \ fpathconf.o \ - fstat.o \ fstatfs.o \ fstatvfs.o \ getcpuid.o \ @@ -250,11 +238,9 @@ COMSYSOBJS= \ ioctl.o \ kaio.o \ kill.o \ - lchown.o \ link.o \ llseek.o \ lseek.o \ - lstat.o \ memcntl.o \ mincore.o \ mkdir.o \ @@ -268,7 +254,6 @@ COMSYSOBJS= \ nice.o \ ntp_adjtime.o \ ntp_gettime.o \ - open.o \ p_online.o \ pathconf.o \ pause.o \ @@ -285,9 +270,7 @@ COMSYSOBJS= \ read.o \ readlink.o \ readv.o \ - rename.o \ resolvepath.o \ - rmdir.o \ seteguid.o \ setgid.o \ setgroups.o \ @@ -299,7 +282,6 @@ COMSYSOBJS= \ sigprocmsk.o \ sigsendset.o \ sigsuspend.o \ - stat.o \ statfs.o \ statvfs.o \ stty.o \ @@ -313,7 +295,6 @@ COMSYSOBJS= \ ulimit.o \ umask.o \ umount2.o \ - unlink.o \ utssys.o \ uucopy.o \ vhangup.o \ @@ -435,7 +416,7 @@ PORTGEN= \ dirname.o \ div.o \ drand48.o \ - dup2.o \ + dup.o \ env_data.o \ err.o \ errno.o \ @@ -841,29 +822,27 @@ UNWINDASMOBJS= \ # objects that implement the transitional large file API PORTSYS64= \ - fstatat64.o \ lockf64.o \ - openat64.o + stat64.o PORTSYS= \ _autofssys.o \ + access.o \ acctctl.o \ bsd_signal.o \ + chown.o \ corectl.o \ exacctsys.o \ execl.o \ execle.o \ execv.o \ - fsmisc.o \ - fstatat.o \ + fcntl.o \ getpagesizes.o \ getpeerucred.o \ inst_sync.o \ issetugid.o \ label.o \ - libc_fcntl.o \ libc_link.o \ - libc_open.o \ lockf.o \ lwp.o \ lwp_cond.o \ @@ -872,12 +851,13 @@ PORTSYS= \ meminfosys.o \ msgsys.o \ nfssys.o \ - openat.o \ + open.o \ pgrpsys.o \ posix_sigwait.o \ ppriv.o \ psetsys.o \ rctlsys.o \ + rename.o \ sbrk.o \ semsys.o \ set_errno.o \ @@ -888,10 +868,12 @@ PORTSYS= \ signal.o \ sigpending.o \ sigstack.o \ + stat.o \ tasksys.o \ time.o \ time_util.o \ ucontext.o \ + unlink.o \ ustat.o \ utimesys.o \ zone.o @@ -1002,6 +984,11 @@ CPPFLAGS= -D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \ -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master) ASFLAGS= $(EXTN_ASFLAGS) -K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH) +# As a favor to the dtrace syscall provider, libc still calls the +# old syscall traps that have been obsoleted by the *at() interfaces. +# Delete this to compile libc using only the new *at() system call traps +CPPFLAGS += -D_RETAIN_OLD_SYSCALLS + # Conditionally add support for making |wordexp()| check whether # /usr/bin/ksh is ksh93 or not include $(LIBCDIR)/../../Makefile.ksh93switch diff --git a/usr/src/lib/libc/sparc/crt/_rtboot.s b/usr/src/lib/libc/sparc/crt/_rtboot.s index 5ae8505d9a..7764d40507 100644 --- a/usr/src/lib/libc/sparc/crt/_rtboot.s +++ b/usr/src/lib/libc/sparc/crt/_rtboot.s @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,13 +18,12 @@ * * CDDL HEADER END */ + /* - * Copyright (c) 2000 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ -#ident "%Z%%M% %I% %E% SMI" - .file "_rtboot.s" ! Bootstrap routine for alias ld.so. Control arrives here either directly @@ -78,8 +76,8 @@ .global __rtboot .local __rtld .local s.LDSO, s.ZERO - .local f.PANIC, f.OPEN, f.MMAP, f.FSTAT, f.SYSCONFIG, f.CLOSE, f.EXIT - .local f.MUNMAP + .local f.PANIC, f.OPENAT, f.MMAP, f.FSTATAT, f.SYSCONFIG + .local f.CLOSE, f.EXIT, f.MUNMAP .type __rtboot, #function .align 4 @@ -138,9 +136,9 @@ __rtboot: SI(ZERO) SI(EMPTY) FI(PANIC) - FI(OPEN) + FI(OPENAT) FI(MMAP) - FI(FSTAT) + FI(FSTATAT) FI(SYSCONFIG) FI(CLOSE) FI(MUNMAP) @@ -179,9 +177,9 @@ f.PANIC: ba f.EXIT ! leave nop -f.OPEN: +f.OPENAT: ba __syscall - mov SYS_open, %g1 + mov SYS_openat, %g1 f.MMAP: sethi %hi(0x80000000), %g1 ! MAP_NEW @@ -209,9 +207,9 @@ f.CLOSE: ba __syscall mov SYS_close, %g1 -f.FSTAT: +f.FSTATAT: ba __syscall - mov SYS_fstat, %g1 + mov SYS_fstatat, %g1 f.SYSCONFIG: ba __syscall diff --git a/usr/src/lib/libc/sparc/crt/_rtld.c b/usr/src/lib/libc/sparc/crt/_rtld.c index 50647dd10c..132aad09c0 100644 --- a/usr/src/lib/libc/sparc/crt/_rtld.c +++ b/usr/src/lib/libc/sparc/crt/_rtld.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Redirection ld.so. Based on the 4.x binary compatibility ld.so, used * to redirect aliases for ld.so to the real one. @@ -56,10 +54,10 @@ #define LDSO strings[LDSO_S] #define ZERO strings[ZERO_S] #define CLOSE (*(funcs[CLOSE_F])) -#define FSTAT (*(funcs[FSTAT_F])) +#define FSTATAT (*(funcs[FSTATAT_F])) #define MMAP (*(funcs[MMAP_F])) #define MUNMAP (*(funcs[MUNMAP_F])) -#define OPEN (*(funcs[OPEN_F])) +#define OPENAT (*(funcs[OPENAT_F])) #define PANIC (*(funcs[PANIC_F])) #define SYSCONFIG (*(funcs[SYSCONFIG_F])) @@ -133,9 +131,9 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) * data structures. Further mappings will actually establish the * program in the address space. */ - if ((ldfd = OPEN(LDSO, O_RDONLY)) == -1) + if ((ldfd = OPENAT(AT_FDCWD, LDSO, O_RDONLY)) == -1) PANIC(program_name); - if (FSTAT(ldfd, &sb) == -1) + if (FSTATAT(ldfd, NULL, &sb, 0) == -1) PANIC(program_name); ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC, MAP_SHARED, ldfd, 0); @@ -291,7 +289,7 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) j = (faddr + pptr->p_vaddr + pptr->p_memsz) - zaddr; if (j > 0) { if (dzfd == 0) { - dzfd = OPEN(ZERO, O_RDWR); + dzfd = OPENAT(AT_FDCWD, ZERO, O_RDWR); if (dzfd == -1) PANIC(program_name); } diff --git a/usr/src/lib/libc/sparc/crt/alias_boot.h b/usr/src/lib/libc/sparc/crt/alias_boot.h index 754d480841..e2a96f933a 100644 --- a/usr/src/lib/libc/sparc/crt/alias_boot.h +++ b/usr/src/lib/libc/sparc/crt/alias_boot.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,15 +18,15 @@ * * CDDL HEADER END */ + /* - * Copyright (c) 1991 Sun Microsystems, Inc. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #ifndef _ALIAS_BOOT_H #define _ALIAS_BOOT_H -#ident "%Z%%M% %I% %E% SMI" - /* * Offsets for string constants used in alias bootstrap. */ @@ -40,9 +39,9 @@ * Offsets for function pointers used in alias bootstrap. */ #define PANIC_F 0 /* panic() */ -#define OPEN_F 1 /* open() */ +#define OPENAT_F 1 /* openat() */ #define MMAP_F 2 /* mmap() */ -#define FSTAT_F 3 /* fstat() */ +#define FSTATAT_F 3 /* fstatat() */ #define SYSCONFIG_F 4 /* sysconfig() */ #define CLOSE_F 5 /* close() */ #define MUNMAP_F 6 /* munmap() */ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index b88e9ba202..d3a3e2e63d 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -186,7 +186,6 @@ COMSYSOBJS= \ _so_socket.o \ _so_socketpair.o \ _sockconfig.o \ - access.o \ acct.o \ acl.o \ adjtime.o \ @@ -194,23 +193,17 @@ COMSYSOBJS= \ brk.o \ chdir.o \ chmod.o \ - chown.o \ chroot.o \ cladm.o \ close.o \ - creat.o \ - dup.o \ execve.o \ exit.o \ facl.o \ fchdir.o \ fchmod.o \ - fchown.o \ fchroot.o \ - fcntl.o \ fdsync.o \ fpathconf.o \ - fstat.o \ fstatfs.o \ fstatvfs.o \ getcpuid.o \ @@ -232,11 +225,9 @@ COMSYSOBJS= \ ioctl.o \ kaio.o \ kill.o \ - lchown.o \ link.o \ llseek.o \ lseek.o \ - lstat.o \ memcntl.o \ mincore.o \ mkdir.o \ @@ -250,7 +241,6 @@ COMSYSOBJS= \ nice.o \ ntp_adjtime.o \ ntp_gettime.o \ - open.o \ p_online.o \ pathconf.o \ pause.o \ @@ -267,9 +257,7 @@ COMSYSOBJS= \ read.o \ readlink.o \ readv.o \ - rename.o \ resolvepath.o \ - rmdir.o \ seteguid.o \ setgid.o \ setgroups.o \ @@ -281,7 +269,6 @@ COMSYSOBJS= \ sigprocmsk.o \ sigsendset.o \ sigsuspend.o \ - stat.o \ statfs.o \ statvfs.o \ stty.o \ @@ -295,7 +282,6 @@ COMSYSOBJS= \ ulimit.o \ umask.o \ umount2.o \ - unlink.o \ utssys.o \ uucopy.o \ vhangup.o \ @@ -396,7 +382,7 @@ PORTGEN= \ dirname.o \ div.o \ drand48.o \ - dup2.o \ + dup.o \ env_data.o \ err.o \ errno.o \ @@ -791,23 +777,22 @@ PORTSYS64= PORTSYS= \ _autofssys.o \ + access.o \ acctctl.o \ bsd_signal.o \ + chown.o \ corectl.o \ exacctsys.o \ execl.o \ execle.o \ execv.o \ - fsmisc.o \ - fstatat.o \ + fcntl.o \ getpagesizes.o \ getpeerucred.o \ inst_sync.o \ issetugid.o \ label.o \ - libc_fcntl.o \ libc_link.o \ - libc_open.o \ lockf.o \ lwp.o \ lwp_cond.o \ @@ -816,12 +801,13 @@ PORTSYS= \ meminfosys.o \ msgsys.o \ nfssys.o \ - openat.o \ + open.o \ pgrpsys.o \ posix_sigwait.o \ ppriv.o \ psetsys.o \ rctlsys.o \ + rename.o \ sbrk.o \ semsys.o \ set_errno.o \ @@ -832,10 +818,12 @@ PORTSYS= \ signal.o \ sigpending.o \ sigstack.o \ + stat.o \ tasksys.o \ time.o \ time_util.o \ ucontext.o \ + unlink.o \ ustat.o \ utimesys.o \ zone.o @@ -947,6 +935,11 @@ CPPFLAGS= -D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \ ASFLAGS= $(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \ $(sparcv9_AS_XARCH) +# As a favor to the dtrace syscall provider, libc still calls the +# old syscall traps that have been obsoleted by the *at() interfaces. +# Delete this to compile libc using only the new *at() system call traps +CPPFLAGS += -D_RETAIN_OLD_SYSCALLS + # Conditionally add support for making |wordexp()| check whether # /usr/bin/ksh is ksh93 or not include $(LIBCDIR)/../../Makefile.ksh93switch |