Date: Fri, 18 Apr 2008 22:12:16 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 140230 for review Message-ID: <200804182212.m3IMCGZu008495@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=140230 Change 140230 by sam@sam_ebb on 2008/04/18 22:11:38 IFC @ 140229 Affected files ... .. //depot/projects/vap/Makefile.inc1#9 integrate .. //depot/projects/vap/etc/rc.d/dhclient#5 integrate .. //depot/projects/vap/gnu/usr.bin/binutils/libbfd/Makefile.i386#3 integrate .. //depot/projects/vap/include/dirent.h#3 integrate .. //depot/projects/vap/include/stdio.h#4 integrate .. //depot/projects/vap/lib/libc/gen/Makefile.inc#7 integrate .. //depot/projects/vap/lib/libc/gen/Symbol.map#4 integrate .. //depot/projects/vap/lib/libc/gen/directory.3#3 integrate .. //depot/projects/vap/lib/libc/gen/opendir.c#3 integrate .. //depot/projects/vap/lib/libc/gen/tcgetsid.3#1 branch .. //depot/projects/vap/lib/libc/gen/termios.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/_flock_stub.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/asprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/fgetwc.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/fgetws.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/findfp.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/fputwc.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/fputws.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/freopen.c#5 integrate .. //depot/projects/vap/lib/libc/stdio/fseek.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/fwide.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/local.h#3 integrate .. //depot/projects/vap/lib/libc/stdio/refill.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/snprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/sprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/sscanf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/ungetc.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/ungetwc.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vasprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vfprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vfwprintf.c#4 integrate .. //depot/projects/vap/lib/libc/stdio/vsnprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vsprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vsscanf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vswprintf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/vswscanf.c#3 integrate .. //depot/projects/vap/lib/libc/stdio/xprintf.c#3 integrate .. //depot/projects/vap/lib/libc/sys/Makefile.inc#7 integrate .. //depot/projects/vap/lib/libc/sys/access.2#6 integrate .. //depot/projects/vap/lib/libc/sys/chmod.2#3 integrate .. //depot/projects/vap/lib/libc/sys/chown.2#3 integrate .. //depot/projects/vap/lib/libc/sys/execve.2#3 integrate .. //depot/projects/vap/lib/libc/sys/link.2#3 integrate .. //depot/projects/vap/lib/libc/sys/mkdir.2#3 integrate .. //depot/projects/vap/lib/libc/sys/mkfifo.2#3 integrate .. //depot/projects/vap/lib/libc/sys/mknod.2#3 integrate .. //depot/projects/vap/lib/libc/sys/open.2#3 integrate .. //depot/projects/vap/lib/libc/sys/readlink.2#5 integrate .. //depot/projects/vap/lib/libc/sys/rename.2#3 integrate .. //depot/projects/vap/lib/libc/sys/stat.2#3 integrate .. //depot/projects/vap/lib/libc/sys/symlink.2#3 integrate .. //depot/projects/vap/lib/libc/sys/unlink.2#3 integrate .. //depot/projects/vap/lib/libc/sys/utimes.2#3 integrate .. //depot/projects/vap/lib/libfetch/common.c#6 integrate .. //depot/projects/vap/lib/libthr/thread/thr_init.c#4 integrate .. //depot/projects/vap/release/doc/en_US.ISO8859-1/relnotes/article.sgml#9 integrate .. //depot/projects/vap/sbin/dhclient/bpf.c#3 integrate .. //depot/projects/vap/share/man/man4/nfe.4#3 integrate .. //depot/projects/vap/sys/amd64/include/cpufunc.h#6 integrate .. //depot/projects/vap/sys/amd64/linux32/linux32_dummy.c#6 integrate .. //depot/projects/vap/sys/amd64/linux32/linux32_proto.h#8 integrate .. //depot/projects/vap/sys/amd64/linux32/linux32_syscall.h#8 integrate .. //depot/projects/vap/sys/amd64/linux32/linux32_sysent.c#8 integrate .. //depot/projects/vap/sys/amd64/linux32/syscalls.master#8 integrate .. //depot/projects/vap/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h#2 integrate .. //depot/projects/vap/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#2 integrate .. //depot/projects/vap/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c#2 integrate .. //depot/projects/vap/sys/contrib/pf/net/pf.c#6 integrate .. //depot/projects/vap/sys/dev/acpi_support/acpi_asus.c#7 integrate .. //depot/projects/vap/sys/dev/ata/ata-all.c#8 integrate .. //depot/projects/vap/sys/dev/ata/ata-all.h#10 integrate .. //depot/projects/vap/sys/dev/ata/ata-chipset.c#10 integrate .. //depot/projects/vap/sys/dev/ata/ata-disk.c#9 integrate .. //depot/projects/vap/sys/dev/ata/ata-dma.c#9 integrate .. //depot/projects/vap/sys/dev/ata/ata-lowlevel.c#9 integrate .. //depot/projects/vap/sys/dev/ata/ata-pci.c#7 integrate .. //depot/projects/vap/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/vap/sys/dev/ata/ata-raid.c#8 integrate .. //depot/projects/vap/sys/dev/ata/atapi-cam.c#7 integrate .. //depot/projects/vap/sys/dev/ata/atapi-cd.c#7 integrate .. //depot/projects/vap/sys/dev/ata/atapi-fd.c#7 integrate .. //depot/projects/vap/sys/dev/ata/atapi-tape.c#7 integrate .. //depot/projects/vap/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c#6 integrate .. //depot/projects/vap/sys/dev/ieee488/ibfoo.c#3 integrate .. //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#13 integrate .. //depot/projects/vap/sys/dev/if_ndis/if_ndisvar.h#10 integrate .. //depot/projects/vap/sys/dev/mfi/mfi.c#6 integrate .. //depot/projects/vap/sys/dev/sound/midi/mpu401.c#3 integrate .. //depot/projects/vap/sys/dev/usb/if_aue.c#6 integrate .. //depot/projects/vap/sys/dev/usb/uipaq.c#3 integrate .. //depot/projects/vap/sys/fs/msdosfs/denode.h#6 integrate .. //depot/projects/vap/sys/fs/msdosfs/msdosfs_vnops.c#8 integrate .. //depot/projects/vap/sys/fs/smbfs/smbfs_node.h#3 integrate .. //depot/projects/vap/sys/fs/smbfs/smbfs_vnops.c#8 integrate .. //depot/projects/vap/sys/fs/tmpfs/tmpfs.h#3 integrate .. //depot/projects/vap/sys/fs/tmpfs/tmpfs_vfsops.c#4 integrate .. //depot/projects/vap/sys/fs/tmpfs/tmpfs_vnops.c#6 integrate .. //depot/projects/vap/sys/gnu/fs/ext2fs/ext2_vnops.c#4 integrate .. //depot/projects/vap/sys/gnu/fs/ext2fs/inode.h#3 integrate .. //depot/projects/vap/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c#4 integrate .. //depot/projects/vap/sys/i386/include/cpufunc.h#6 integrate .. //depot/projects/vap/sys/i386/linux/linux_dummy.c#6 integrate .. //depot/projects/vap/sys/i386/linux/linux_proto.h#8 integrate .. //depot/projects/vap/sys/i386/linux/linux_syscall.h#8 integrate .. //depot/projects/vap/sys/i386/linux/linux_sysent.c#8 integrate .. //depot/projects/vap/sys/i386/linux/syscalls.master#8 integrate .. //depot/projects/vap/sys/ia64/conf/DEFAULTS#5 integrate .. //depot/projects/vap/sys/ia64/ia64/clock.c#6 integrate .. //depot/projects/vap/sys/ia64/ia64/nexus.c#7 integrate .. //depot/projects/vap/sys/ia64/include/vmparam.h#6 integrate .. //depot/projects/vap/sys/kern/kern_intr.c#11 integrate .. //depot/projects/vap/sys/kern/kern_linker.c#8 integrate .. //depot/projects/vap/sys/kern/kern_lockf.c#8 integrate .. //depot/projects/vap/sys/kern/kern_subr.c#5 integrate .. //depot/projects/vap/sys/kern/kern_switch.c#9 integrate .. //depot/projects/vap/sys/kern/kern_synch.c#9 integrate .. //depot/projects/vap/sys/kern/kern_thread.c#11 integrate .. //depot/projects/vap/sys/kern/sched_4bsd.c#11 integrate .. //depot/projects/vap/sys/kern/sched_ule.c#14 integrate .. //depot/projects/vap/sys/kern/subr_sleepqueue.c#12 integrate .. //depot/projects/vap/sys/kern/subr_trap.c#9 integrate .. //depot/projects/vap/sys/kern/subr_turnstile.c#7 integrate .. //depot/projects/vap/sys/kern/subr_witness.c#12 integrate .. //depot/projects/vap/sys/kern/tty.c#8 integrate .. //depot/projects/vap/sys/kern/vfs_default.c#11 integrate .. //depot/projects/vap/sys/kern/vfs_subr.c#14 integrate .. //depot/projects/vap/sys/mips/conf/SENTRY5#2 integrate .. //depot/projects/vap/sys/mips/mips/cache.c#2 integrate .. //depot/projects/vap/sys/mips/mips/copystr.S#2 integrate .. //depot/projects/vap/sys/net/bpf.c#13 integrate .. //depot/projects/vap/sys/net/if_tap.c#6 integrate .. //depot/projects/vap/sys/netgraph/bluetooth/include/ng_bluetooth.h#3 integrate .. //depot/projects/vap/sys/netgraph/netflow/ng_netflow.c#8 integrate .. //depot/projects/vap/sys/netgraph/netgraph.h#8 integrate .. //depot/projects/vap/sys/netgraph/ng_base.c#17 integrate .. //depot/projects/vap/sys/netinet/in.h#7 integrate .. //depot/projects/vap/sys/netinet/in_mcast.c#3 integrate .. //depot/projects/vap/sys/netinet/in_pcb.c#12 integrate .. //depot/projects/vap/sys/netinet/in_pcb.h#8 integrate .. //depot/projects/vap/sys/netinet/ip_divert.c#5 integrate .. //depot/projects/vap/sys/netinet/ip_fw2.c#11 integrate .. //depot/projects/vap/sys/netinet/ip_icmp.c#6 integrate .. //depot/projects/vap/sys/netinet/ip_options.c#4 integrate .. //depot/projects/vap/sys/netinet/ip_output.c#9 integrate .. //depot/projects/vap/sys/netinet/raw_ip.c#6 integrate .. //depot/projects/vap/sys/netinet/sctp_asconf.c#3 integrate .. //depot/projects/vap/sys/netinet/sctp_bsd_addr.c#5 integrate .. //depot/projects/vap/sys/netinet/sctp_bsd_addr.h#3 integrate .. //depot/projects/vap/sys/netinet/sctp_input.c#5 integrate .. //depot/projects/vap/sys/netinet/sctp_output.c#6 integrate .. //depot/projects/vap/sys/netinet/sctp_pcb.c#5 integrate .. //depot/projects/vap/sys/netinet/sctp_pcb.h#3 integrate .. //depot/projects/vap/sys/netinet/sctp_sysctl.c#3 integrate .. //depot/projects/vap/sys/netinet/sctp_usrreq.c#5 integrate .. //depot/projects/vap/sys/netinet/sctp_var.h#4 integrate .. //depot/projects/vap/sys/netinet/sctputil.c#5 integrate .. //depot/projects/vap/sys/netinet/sctputil.h#3 integrate .. //depot/projects/vap/sys/netinet/tcp_input.c#8 integrate .. //depot/projects/vap/sys/netinet/tcp_output.c#8 integrate .. //depot/projects/vap/sys/netinet/tcp_reass.c#3 integrate .. //depot/projects/vap/sys/netinet/tcp_sack.c#6 integrate .. //depot/projects/vap/sys/netinet/tcp_subr.c#7 integrate .. //depot/projects/vap/sys/netinet/tcp_syncache.c#7 integrate .. //depot/projects/vap/sys/netinet/tcp_timer.c#5 integrate .. //depot/projects/vap/sys/netinet/tcp_timewait.c#3 integrate .. //depot/projects/vap/sys/netinet/tcp_usrreq.c#8 integrate .. //depot/projects/vap/sys/netinet/udp_usrreq.c#6 integrate .. //depot/projects/vap/sys/netinet6/icmp6.c#7 integrate .. //depot/projects/vap/sys/netinet6/in6_pcb.c#7 integrate .. //depot/projects/vap/sys/netinet6/in6_src.c#8 integrate .. //depot/projects/vap/sys/netinet6/raw_ip6.c#8 integrate .. //depot/projects/vap/sys/netinet6/udp6_usrreq.c#7 integrate .. //depot/projects/vap/sys/nfs4client/nfs4_vnops.c#11 integrate .. //depot/projects/vap/sys/nfsclient/nfs_lock.c#6 integrate .. //depot/projects/vap/sys/nfsclient/nfs_vnops.c#11 integrate .. //depot/projects/vap/sys/nfsclient/nfsnode.h#7 integrate .. //depot/projects/vap/sys/nlm/nlm_prot_impl.c#4 integrate .. //depot/projects/vap/sys/powerpc/aim/locore.S#4 integrate .. //depot/projects/vap/sys/powerpc/aim/machdep.c#5 integrate .. //depot/projects/vap/sys/powerpc/aim/mmu_oea.c#2 integrate .. //depot/projects/vap/sys/security/audit/audit_arg.c#6 integrate .. //depot/projects/vap/sys/security/mac/mac_inet.c#5 integrate .. //depot/projects/vap/sys/sparc64/pci/apb.c#6 integrate .. //depot/projects/vap/sys/sparc64/pci/ofw_pci_if.m#5 integrate .. //depot/projects/vap/sys/sparc64/pci/ofw_pcib.c#5 integrate .. //depot/projects/vap/sys/sparc64/pci/ofw_pcib_subr.c#5 integrate .. //depot/projects/vap/sys/sparc64/pci/ofw_pcib_subr.h#3 integrate .. //depot/projects/vap/sys/sparc64/pci/ofw_pcibus.c#6 integrate .. //depot/projects/vap/sys/sparc64/pci/psycho.c#6 integrate .. //depot/projects/vap/sys/sparc64/pci/psychovar.h#5 integrate .. //depot/projects/vap/sys/sys/lockf.h#7 integrate .. //depot/projects/vap/sys/sys/param.h#18 integrate .. //depot/projects/vap/sys/sys/proc.h#14 integrate .. //depot/projects/vap/sys/sys/sched.h#9 integrate .. //depot/projects/vap/sys/sys/sysctl.h#8 integrate .. //depot/projects/vap/sys/sys/termios.h#3 integrate .. //depot/projects/vap/sys/sys/ttycom.h#5 integrate .. //depot/projects/vap/sys/sys/vnode.h#12 integrate .. //depot/projects/vap/sys/ufs/ufs/inode.h#6 integrate .. //depot/projects/vap/sys/ufs/ufs/ufs_vnops.c#8 integrate .. //depot/projects/vap/sys/vm/vm_glue.c#8 integrate .. //depot/projects/vap/sys/vm/vm_zeroidle.c#7 integrate .. //depot/projects/vap/usr.bin/env/env.1#3 integrate .. //depot/projects/vap/usr.bin/env/env.c#3 integrate .. //depot/projects/vap/usr.bin/netstat/sctp.c#4 integrate .. //depot/projects/vap/usr.sbin/ndiscvt/inf.c#3 integrate .. //depot/projects/vap/usr.sbin/pkg_install/info/main.c#3 integrate .. //depot/projects/vap/usr.sbin/pkg_install/info/perform.c#3 integrate Differences ... ==== //depot/projects/vap/Makefile.inc1#9 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.602 2008/03/29 17:44:38 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.603 2008/04/15 05:14:42 ru Exp $ # # Make command line options: # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir @@ -963,10 +963,12 @@ # # cross-tools: Build cross-building tools # -.if ${TARGET_ARCH} != ${MACHINE_ARCH} +.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld .endif +.endif +.if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ${MK_RESCUE} != "no" || defined(RELEASEDIR) _crunchide= usr.sbin/crunch/crunchide .endif ==== //depot/projects/vap/etc/rc.d/dhclient#5 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/dhclient,v 1.31 2008/02/01 23:43:58 brooks Exp $ +# $FreeBSD: src/etc/rc.d/dhclient,v 1.32 2008/04/15 23:03:35 brooks Exp $ # # PROVIDE: dhclient @@ -26,6 +26,10 @@ if [ -n "$pids" ]; then exit 0 fi + elif [ -e /var/run/dhclient.pid ]; then + if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then + exit 0 + fi fi fi ==== //depot/projects/vap/gnu/usr.bin/binutils/libbfd/Makefile.i386#3 (text+ko) ==== @@ -1,12 +1,19 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.i386,v 1.17 2004/07/08 17:05:32 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.i386,v 1.18 2008/04/17 23:36:35 marcel Exp $ DEFAULT_VECTOR= bfd_elf32_i386_freebsd_vec -SRCS+= cpu-i386.c \ +SRCS+= cofflink.c \ + cpu-i386.c \ + efi-app-ia32.c \ elf32-i386.c \ elf32-target.h \ elf32.c \ - elflink.c + elflink.c \ + peigen.c VECS= ${DEFAULT_VECTOR} \ - bfd_elf32_i386_vec + bfd_elf32_i386_vec \ + bfd_efi_app_ia32_vec + +peigen.c: peXXigen.c + sed -e s/XX/pe/g ${.ALLSRC} > ${.TARGET} ==== //depot/projects/vap/include/dirent.h#3 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dirent.h 8.2 (Berkeley) 7/28/94 - * $FreeBSD: src/include/dirent.h,v 1.15 2007/11/20 01:49:00 jb Exp $ + * $FreeBSD: src/include/dirent.h,v 1.16 2008/04/16 18:59:35 delphij Exp $ */ #ifndef _DIRENT_H_ @@ -100,6 +100,7 @@ int getdirentries(int, char *, int, long *); #endif DIR *opendir(const char *); +DIR *fdopendir(int); struct dirent * readdir(DIR *); #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 ==== //depot/projects/vap/include/stdio.h#4 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)stdio.h 8.5 (Berkeley) 4/29/95 - * $FreeBSD: src/include/stdio.h,v 1.62 2008/03/31 12:14:04 kib Exp $ + * $FreeBSD: src/include/stdio.h,v 1.64 2008/04/17 22:17:53 jhb Exp $ */ #ifndef _STDIO_H_ @@ -72,9 +72,6 @@ int _size; }; -/* hold a buncha junk that would grow the ABI */ -struct __sFILEX; - /* * stdio state variables. * @@ -98,15 +95,19 @@ * that does not match the previous one in _bf. When this happens, * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * Certain members of __sFILE are accessed directly via macros or + * inline functions. To preserve ABI compat, these members must not + * be disturbed. These members are marked below with (*). */ typedef struct __sFILE { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ + unsigned char *_p; /* (*) current position in (some) buffer */ + int _r; /* (*) read space left for getc() */ + int _w; /* (*) write space left for putc() */ + short _flags; /* (*) flags, below; this FILE is free if 0 */ + short _file; /* (*) fileno, if Unix descriptor, else -1 */ struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ + int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */ /* operations */ void *_cookie; /* cookie passed to io functions */ @@ -117,7 +118,7 @@ /* separate buffer for long sequences of ungetc() */ struct __sbuf _ub; /* ungetc buffer */ - struct __sFILEX *_extra; /* additions to FILE to not break ABI */ + unsigned char *_up; /* saved _p when _p is doing ungetc data */ int _ur; /* saved _r when _r is counting ungetc data */ /* tricks to meet minimum requirements even when malloc() fails */ @@ -130,6 +131,12 @@ /* Unix stdio files get aligned to block boundaries on fseek() */ int _blksize; /* stat.st_blksize (may be != _bf._size) */ fpos_t _offset; /* current lseek offset */ + + struct pthread_mutex *_fl_mutex; /* used for MT-safety */ + struct pthread *_fl_owner; /* current owner */ + int _fl_count; /* recursive lock count */ + int _orientation; /* orientation for fwide() */ + __mbstate_t _mbstate; /* multibyte conversion state */ } FILE; #ifndef _STDSTREAM_DECLARED ==== //depot/projects/vap/lib/libc/gen/Makefile.inc#7 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.133 2008/03/29 16:19:35 das Exp $ +# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.135 2008/04/16 18:59:35 delphij Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen @@ -63,7 +63,7 @@ setjmp.3 setmode.3 setproctitle.3 \ siginterrupt.3 signal.3 sigsetops.3 sleep.3 \ statvfs.3 stringlist.3 \ - strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \ + strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 tcgetsid.3 \ tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \ ttyname.3 tzset.3 ualarm.3 ucontext.3 ulimit.3 uname.3 \ unvis.3 usleep.3 utime.3 valloc.3 vis.3 wordexp.3 @@ -72,6 +72,7 @@ MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ + directory.3 fdopendir.3 \ directory.3 readdir.3 directory.3 readdir_r.3 directory.3 rewinddir.3 \ directory.3 seekdir.3 directory.3 telldir.3 MLINKS+=dlopen.3 dlclose.3 dlopen.3 dlerror.3 dlopen.3 dlfunc.3 \ ==== //depot/projects/vap/lib/libc/gen/Symbol.map#4 (text) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/lib/libc/gen/Symbol.map,v 1.8 2008/01/26 17:09:40 yar Exp $ + * $FreeBSD: src/lib/libc/gen/Symbol.map,v 1.10 2008/04/16 18:59:36 delphij Exp $ */ FBSD_1.0 { @@ -329,6 +329,7 @@ }; FBSD_1.1 { + fdopendir; fts_open; fts_close; fts_read; @@ -337,6 +338,7 @@ fts_get_clientptr; fts_get_stream; fts_set_clientptr; + tcgetsid; }; FBSDprivate_1.0 { ==== //depot/projects/vap/lib/libc/gen/directory.3#3 (text+ko) ==== @@ -26,13 +26,14 @@ .\" SUCH DAMAGE. .\" .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/directory.3,v 1.16 2007/01/09 00:27:53 imp Exp $ +.\" $FreeBSD: src/lib/libc/gen/directory.3,v 1.17 2008/04/16 18:59:36 delphij Exp $ .\" -.Dd June 4, 1993 +.Dd April 16, 2008 .Dt DIRECTORY 3 .Os .Sh NAME .Nm opendir , +.Nm fdopendir , .Nm readdir , .Nm readdir_r , .Nm telldir , @@ -48,6 +49,8 @@ .In dirent.h .Ft DIR * .Fn opendir "const char *filename" +.Ft DIR * +.Fn fdopendir "int fd" .Ft struct dirent * .Fn readdir "DIR *dirp" .Ft int @@ -84,6 +87,36 @@ enough memory to hold the whole thing. .Pp The +.Fn fdopendir +function is equivalent to the +.Fn opendir +function except that the directory is specified by a file descriptor +.Fa fd +rather than by a name. +The file offset associated with the file descriptor at the time of the call +determines which entries are returned. +.Pp +Upon successful return from +.Fn fdopendir , +the file descriptor is under the control of the system, +and if any attempt is made to close the file descriptor, +or to modify the state of the associated description other than by means +of +.Fn closedir , +.Fn readdir , +.Fn readdir_r , +or +.Fn rewinddir , +the behavior is undefined. +Upon calling +.Fn closedir +the file descriptor is closed. +The +.Dv FD_CLOEXEC +flag is set on the file descriptor by a successful call to +.Fn fdopendir . +.Pp +The .Fn readdir function returns a pointer to the next directory entry. @@ -202,3 +235,7 @@ .Fn dirfd functions appeared in .Bx 4.2 . +The +.Fn fdopendir +function appeared in +.Fx 8.0 . ==== //depot/projects/vap/lib/libc/gen/opendir.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * @@ -31,7 +31,7 @@ static char sccsid[] = "@(#)opendir.c 8.8 (Berkeley) 5/1/95"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/gen/opendir.c,v 1.23 2007/01/09 00:27:54 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/opendir.c,v 1.25 2008/04/16 18:59:36 delphij Exp $"); #include "namespace.h" #include <sys/param.h> @@ -47,32 +47,38 @@ #include "un-namespace.h" #include "telldir.h" + +static DIR * __opendir_common(int, const char *, int); + /* * Open a directory. */ DIR * -opendir(name) - const char *name; +opendir(const char *name) { return (__opendir2(name, DTF_HIDEW|DTF_NODUP)); } +/* + * Open a directory with existing file descriptor. + */ +DIR * +fdopendir(int fd) +{ + + return (__opendir_common(fd, NULL, DTF_HIDEW|DTF_NODUP)); +} + DIR * -__opendir2(name, flags) - const char *name; - int flags; +__opendir2(const char *name, int flags) { - DIR *dirp; int fd; - int incr; - int saved_errno; - int unionstack; struct stat statb; /* * stat() before _open() because opening of special files may be - * harmful. _fstat() after open because the file may have changed. + * harmful. */ if (stat(name, &statb) != 0) return (NULL); @@ -82,7 +88,24 @@ } if ((fd = _open(name, O_RDONLY | O_NONBLOCK)) == -1) return (NULL); + + return __opendir_common(fd, name, flags); +} + +/* + * Common routine for opendir(3), __opendir2(3) and fdopendir(3). + */ +static DIR * +__opendir_common(int fd, const char *name, int flags) +{ + DIR *dirp; + int incr; + int saved_errno; + int unionstack; + struct stat statb; + dirp = NULL; + /* _fstat() the open handler because the file may have changed. */ if (_fstat(fd, &statb) != 0) goto fail; if (!S_ISDIR(statb.st_mode)) { ==== //depot/projects/vap/lib/libc/gen/termios.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ static char sccsid[] = "@(#)termios.c 8.2 (Berkeley) 2/21/94"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/gen/termios.c,v 1.14 2007/01/09 00:27:55 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/termios.c,v 1.15 2008/04/15 08:33:32 davidxu Exp $"); #include "namespace.h" #include <sys/types.h> @@ -99,6 +99,17 @@ return ((pid_t)s); } +pid_t +tcgetsid(int fd) +{ + int s; + + if (_ioctl(fd, TIOCGSID, &s) < 0) + return ((pid_t)-1); + + return ((pid_t)s); +} + speed_t cfgetospeed(t) const struct termios *t; ==== //depot/projects/vap/lib/libc/stdio/_flock_stub.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/_flock_stub.c,v 1.15 2007/01/12 07:31:30 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/_flock_stub.c,v 1.16 2008/04/17 22:17:53 jhb Exp $"); #include "namespace.h" #include <stdio.h> @@ -55,31 +55,21 @@ __weak_reference(_ftrylockfile, ftrylockfile); __weak_reference(_funlockfile, funlockfile); -/* - * We need to retain binary compatibility for a while. So pretend - * that _lock is part of FILE * even though it is dereferenced off - * _extra now. When we stop encoding the size of FILE into binaries - * this can be changed in stdio.h. This will reduce the amount of - * code that has to change in the future (just remove this comment - * and #define). - */ -#define _lock _extra - void _flockfile(FILE *fp) { pthread_t curthread = _pthread_self(); - if (fp->_lock->fl_owner == curthread) - fp->_lock->fl_count++; + if (fp->_fl_owner == curthread) + fp->_fl_count++; else { /* * Make sure this mutex is treated as a private * internal mutex: */ - _pthread_mutex_lock(&fp->_lock->fl_mutex); - fp->_lock->fl_owner = curthread; - fp->_lock->fl_count = 1; + _pthread_mutex_lock(&fp->_fl_mutex); + fp->_fl_owner = curthread; + fp->_fl_count = 1; } } @@ -98,15 +88,15 @@ pthread_t curthread = _pthread_self(); int ret = 0; - if (fp->_lock->fl_owner == curthread) - fp->_lock->fl_count++; + if (fp->_fl_owner == curthread) + fp->_fl_count++; /* * Make sure this mutex is treated as a private * internal mutex: */ - else if (_pthread_mutex_trylock(&fp->_lock->fl_mutex) == 0) { - fp->_lock->fl_owner = curthread; - fp->_lock->fl_count = 1; + else if (_pthread_mutex_trylock(&fp->_fl_mutex) == 0) { + fp->_fl_owner = curthread; + fp->_fl_count = 1; } else ret = -1; @@ -121,26 +111,26 @@ /* * Check if this file is owned by the current thread: */ - if (fp->_lock->fl_owner == curthread) { + if (fp->_fl_owner == curthread) { /* * Check if this thread has locked the FILE * more than once: */ - if (fp->_lock->fl_count > 1) + if (fp->_fl_count > 1) /* * Decrement the count of the number of * times the running thread has locked this * file: */ - fp->_lock->fl_count--; + fp->_fl_count--; else { /* * The running thread will release the * lock now: */ - fp->_lock->fl_count = 0; - fp->_lock->fl_owner = NULL; - _pthread_mutex_unlock(&fp->_lock->fl_mutex); + fp->_fl_count = 0; + fp->_fl_owner = NULL; + _pthread_mutex_unlock(&fp->_fl_mutex); } } } ==== //depot/projects/vap/lib/libc/stdio/asprintf.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/asprintf.c,v 1.13 2002/09/26 13:09:48 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/asprintf.c,v 1.14 2008/04/17 22:17:53 jhb Exp $"); #include <stdio.h> #include <stdlib.h> @@ -43,7 +43,6 @@ int ret; va_list ap; FILE f; - struct __sFILEX ext; f._file = -1; f._flags = __SWR | __SSTR | __SALC; @@ -54,8 +53,8 @@ return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ - f._extra = &ext; - INITEXTRA(&f); + f._orientation = 0; + memset(&f._mbstate, 0, sizeof(mbstate_t)); va_start(ap, fmt); ret = __vfprintf(&f, fmt, ap); /* Use unlocked __vfprintf */ va_end(ap); ==== //depot/projects/vap/lib/libc/stdio/fgetwc.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetwc.c,v 1.12 2004/07/20 08:27:27 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetwc.c,v 1.13 2008/04/17 22:17:53 jhb Exp $"); #include "namespace.h" #include <errno.h> @@ -71,7 +71,7 @@ return (wc); } do { - nconv = __mbrtowc(&wc, fp->_p, fp->_r, &fp->_extra->mbstate); + nconv = __mbrtowc(&wc, fp->_p, fp->_r, &fp->_mbstate); if (nconv == (size_t)-1) break; else if (nconv == (size_t)-2) ==== //depot/projects/vap/lib/libc/stdio/fgetws.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetws.c,v 1.6 2004/10/03 15:48:32 stefanf Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetws.c,v 1.7 2008/04/17 22:17:53 jhb Exp $"); #include "namespace.h" #include <errno.h> @@ -62,7 +62,7 @@ nl = memchr(fp->_p, '\n', fp->_r); nconv = __mbsnrtowcs(wsp, &src, nl != NULL ? (nl - fp->_p + 1) : fp->_r, - n - 1, &fp->_extra->mbstate); + n - 1, &fp->_mbstate); if (nconv == (size_t)-1) /* Conversion error */ goto error; @@ -86,7 +86,7 @@ if (wsp == ws) /* EOF */ goto error; - if (!__mbsinit(&fp->_extra->mbstate)) + if (!__mbsinit(&fp->_mbstate)) /* Incomplete character */ goto error; *wsp++ = L'\0'; ==== //depot/projects/vap/lib/libc/stdio/findfp.c#3 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.31 2007/01/09 00:28:06 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.32 2008/04/17 22:17:53 jhb Exp $"); #include <sys/param.h> #include <machine/atomic.h> @@ -54,36 +54,19 @@ #define NDYNAMIC 10 /* add ten more whenever necessary */ #define std(flags, file) \ - {0,0,0,flags,file,{0},0,__sF+file,__sclose,__sread,__sseek,__swrite, \ - {0}, __sFX + file} + {0,0,0,flags,file,{0},0,__sF+file,__sclose,__sread,__sseek,__swrite} /* p r w flags file _bf z cookie close read seek write */ - /* _ub _extra */ + /* the usual - (stdin + stdout + stderr) */ static FILE usual[FOPEN_MAX - 3]; -static struct __sFILEX usual_extra[FOPEN_MAX - 3]; static struct glue uglue = { NULL, FOPEN_MAX - 3, usual }; -static struct __sFILEX __sFX[3]; - -/* - * We can't make this 'static' until 6.0-current due to binary - * compatibility concerns. This also means we cannot change the - * sizeof(FILE) until that time either and must continue to use the - * __sFILEX stuff to add to FILE. - */ -FILE __sF[3] = { +static FILE __sF[3] = { std(__SRD, STDIN_FILENO), std(__SWR, STDOUT_FILENO), std(__SWR|__SNBF, STDERR_FILENO) }; -/* - * The following kludge is done to ensure enough binary compatibility - * with future versions of libc. Or rather it allows us to work with - * libraries that have been built with a newer libc that defines these - * symbols and expects libc to provide them. We only have need to support - * i386 because it is the only "old" system we have deployed. - */ FILE *__stdinp = &__sF[0]; FILE *__stdoutp = &__sF[1]; FILE *__stderrp = &__sF[2]; @@ -109,25 +92,17 @@ { struct glue *g; static FILE empty; - static struct __sFILEX emptyx; FILE *p; - struct __sFILEX *fx; - g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE) + - n * sizeof(struct __sFILEX)); + g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE)); if (g == NULL) return (NULL); p = (FILE *)ALIGN(g + 1); - fx = (struct __sFILEX *)&p[n]; g->next = NULL; g->niobs = n; g->iobs = p; - while (--n >= 0) { - *p = empty; - p->_extra = fx; - *p->_extra = emptyx; - p++, fx++; - } + while (--n >= 0) + *p++ = empty; return (g); } @@ -175,8 +150,8 @@ fp->_lb._base = NULL; /* no line buffer */ fp->_lb._size = 0; /* fp->_lock = NULL; */ /* once set always set (reused) */ - fp->_extra->orientation = 0; - memset(&fp->_extra->mbstate, 0, sizeof(mbstate_t)); + fp->_orientation = 0; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); return (fp); } @@ -229,17 +204,8 @@ void __sinit() { - int i; - THREAD_LOCK(); - if (__sdidinit == 0) { - /* Set _extra for the usual suspects. */ - for (i = 0; i < FOPEN_MAX - 3; i++) - usual[i]._extra = &usual_extra[i]; - - /* Make sure we clean up on exit. */ - __cleanup = _cleanup; /* conservative */ - __sdidinit = 1; - } - THREAD_UNLOCK(); + /* Make sure we clean up on exit. */ + __cleanup = _cleanup; /* conservative */ + __sdidinit = 1; } ==== //depot/projects/vap/lib/libc/stdio/fputwc.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/fputwc.c,v 1.10 2004/07/20 08:27:27 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputwc.c,v 1.11 2008/04/17 22:17:53 jhb Exp $"); #include "namespace.h" #include <errno.h> @@ -56,8 +56,7 @@ *buf = (unsigned char)wc; len = 1; } else { - if ((len = __wcrtomb(buf, wc, &fp->_extra->mbstate)) == - (size_t)-1) { + if ((len = __wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) { fp->_flags |= __SERR; return (WEOF); } ==== //depot/projects/vap/lib/libc/stdio/fputws.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.6 2004/07/21 10:54:57 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.7 2008/04/17 22:17:53 jhb Exp $"); #include "namespace.h" #include <errno.h> @@ -55,7 +55,7 @@ iov.iov_base = buf; do { nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf), - &fp->_extra->mbstate); + &fp->_mbstate); if (nbytes == (size_t)-1) goto error; iov.iov_len = uio.uio_resid = nbytes; ==== //depot/projects/vap/lib/libc/stdio/freopen.c#5 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/freopen.c,v 1.20 2008/02/27 21:25:19 jhb Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/freopen.c,v 1.21 2008/04/17 22:17:54 jhb Exp $"); #include "namespace.h" #include <sys/types.h> @@ -182,8 +182,8 @@ if (HASLB(fp)) FREELB(fp); fp->_lb._size = 0; - fp->_extra->orientation = 0; - memset(&fp->_extra->mbstate, 0, sizeof(mbstate_t)); + fp->_orientation = 0; + memset(&fp->_mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ fp->_flags = 0; /* set it free */ ==== //depot/projects/vap/lib/libc/stdio/fseek.c#3 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)fseek.c 8.3 (Berkeley) 1/2/94"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdio/fseek.c,v 1.43 2007/06/18 02:09:08 ache Exp $"); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804182212.m3IMCGZu008495>