Commit Graph

953 Commits

Author SHA1 Message Date
Peter Edwards
07dee1a777 Fix some^Wseveral style bugs from last commit.
Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and so avoid littering fts.h with any of the
details.

Pointed out By: bde, kientzle
2004-05-12 21:38:39 +00:00
Bruce Evans
d98d9ce623 Fixed style bugs in previous commit (bogus forward declaration and
inconsistent capitalization in comments).
2004-05-10 09:36:26 +00:00
Peter Edwards
99ca5b8804 The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to its
parent, to represent the ".." node, and stops calling stat(2) when
all links are accounted for in a given directory.

This assumption is really only valid for UNIX-like filesystems: A
concrete example is NTFS. The NTFS "i-node" does contain a link
count, but most/all directories have a link count between 0 and 2
inclusive. The end result is that find on an NTFS volume won't
actually traverse the entire hierarchy of the directories passed
to it. (Those with a link count of two are not traversed at all)

The fix checks the "UFSness" of the filesystem before enabling the
optimisation.

Reviewed By: Tim Kientzle (kientzle@)
2004-05-08 15:09:02 +00:00
Pawel Jakub Dawidek
01b013a1ee - Look into geom/gate/ and geom/concat/ for includes.
- Put geom/ subdirectories into separate line,
  while there are more to come.
2004-04-30 16:23:08 +00:00
Tim J. Robbins
e267671499 Make isblank() visible in the C99 namespace.
PR:		63371
Submitted by:	Stefan Farfeleder
2004-04-21 13:25:55 +00:00
Tim J. Robbins
257982eb0f Parenthesize function names in masking macros for getc() etc. for the
benefit of obsolete C preprocessors.
2004-03-20 11:45:52 +00:00
Tim J. Robbins
567d74a5ec Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
2004-03-17 01:43:08 +00:00
Dag-Erling Smørgrav
5b3ce02186 Don't try to pass off a struct sockaddr as a struct sockaddr_in when it
may in fact very well be a struct sockaddr_in6.  Just use plain struct
sockaddr.

This brings us yet another step closer to a clean -O2 build.
2004-03-15 17:08:28 +00:00
Max Laier
278445ba35 Add skeleton build dirs for pf userland:
libexec/ftp-proxy	- ftp proxy for pf
 sbin/pfctl		- equivalent to sbin/ipf
 sbin/pflogd		- deamon logging packets via if_pflog in pcap format
 usr.sbin/authpf	- authentification shell to modify pf rulesets

Bring along some altq headers used to satisfy pfctl/authpf compile. This
helps to keep the diff down and will make it easy to have a altq-patchset
use the full powers of pf.

Also make sure that the pf headers are installed.

This does not link anything to the build. There will be a NO_PF switch for
make.conf once pf userland is linked.

Approved by:	bms(mentor)
2004-02-28 21:50:50 +00:00
Bruce M Simpson
c39ebb1dbb Sync HEAD sources to vendor branch import of routed v2.27 from rhyolite.com.
Update <protocols/routed.h> for the MD5 changes requested in bin/35843.
Preserve local changes.

Education by:	obrien, markm, pointy-stick
PR:		bin/35843 (and doubtless others)
2004-02-25 23:45:57 +00:00
Brian Feldman
33dee81933 Make the resolver(3) and many associated interfaces much more reentrant.
The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
with what should be totally reentrant, and h_errno values will now
be preserved correctly, but this does not affect interfaces such as
gethostbyname(3) which are still mostly non-reentrant.

In all of these relevant functions, the thread-safety has been pushed
down as far as it seems possible right now.  This means that operations
that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
still under global locks that getaddrinfo(3) defines, but where possible
the locking is greatly reduced.  The most noticeable improvement is
that multiple DNS lookups can now be run at the same time, and this
shows major improvement in performance of DNS-lookup threaded programs,
and solves the "Mozilla tab serialization" problem.

No single-threaded applications need to be recompiled.  Multi-threaded
applications that reference "_res" to change resolver(3) options will
need to be recompiled, and ones which reference "h_errno" will also
if they desire the correct h_errno values.  If the applications already
understood that _res and h_errno were not thread-safe and had their own
locking, they will see no performance improvement but will not
actually break in any way.

Please note that when NSS modules are used, or when nsdispatch(3)
defaults to adding any lookups of its own to the individual libc
_nsdispatch() calls, those MUST be reentrant as well.
2004-02-25 21:03:46 +00:00
Andrey A. Chernov
f99a4b252c Add getopt_long_only() 2004-02-24 08:09:20 +00:00
Andrey A. Chernov
05efcb983c In the comment tell about optreset extension for NetBSD ghetopt_long() 2004-02-23 08:14:18 +00:00
Andrey A. Chernov
de693dcb58 Add optreset to getopt.h too since NetBSD getopt_long() (but not GNU one)
use it too.
2004-02-23 04:51:07 +00:00
Andrey A. Chernov
1919b885d0 Try to better mimic GNU getopt.h which does not assume to make visible
all unistd.h functions, use _GETOPT_DECLARE define for that.
2004-02-23 04:17:59 +00:00
Andrey A. Chernov
3f52a8ab55 Fix comment: GNU getopt.h to which this header tries to mimic does not declare
getsubopt/optreset
2004-02-23 03:47:28 +00:00
Andrey A. Chernov
8720578d06 POSIX clearly states that getsubopt() should be declared in <stdlib.h>,
not in <unistd.h>
2004-02-23 03:16:59 +00:00
Maksim Yevmenkin
18d948adb1 Add NO_BLUETOOTH knob to the build process
Requested by:	phk
Reviewed by:	imp (mentor), ru
2004-01-28 00:42:51 +00:00
Hajimu UMEMOTO
c77fb52188 remove EAI_NODATA aliased to EAI_NONAME.
PR:		bin/61369
2004-01-15 15:10:02 +00:00
Dag-Erling Smørgrav
f434fe1237 Add and document ffsl(), fls() and flsl(). 2004-01-13 16:05:47 +00:00
Jacques Vidrine
c849849d06 It was reported that when using nss_ldap, getgrent(3) would behave
incorrectly when encountering `large' groups (many members and/or many
long member names).  The reporter tracked this down to the glibc NSS
module compatibility code (nss_compat.c): it would prematurely record
that a NSS module was finished iterating through its database in some
cases.

Two aspects are corrected:

1. nss_compat.c recorded that a NSS module was finished iterating
   whenever the module reported something other than SUCCESS.  The
   correct logic is to continue iteration when the module reports
   either SUCCESS or RETURN.  The __nss_compat_getgrent_r and
   __nss_compat_getpwent_r routines are updated to reflect this.

2. An internal helper macro __nss_compat_result is used to map glibc
   NSS status codes to BSD NSS status codes (e.g. NSS_STATUS_SUCCESS ->
   NS_SUCCESS).  It provided the obvious mapping.

   When a NSS routine is called with a too-small buffer, the
   convention in the BSD NSS code is to report RETURN.  (This is used
   to implement reentrant APIs such as getpwnam_r(3).)  However, the
   convention in glibc for this case is to set errno = ERANGE and
   overload TRYAGAIN.  __nss_compat_result is updated to handle this
   case.

PR:		bin/60287
Reported by:	Lachlan O'Dea <odela01@ca.com>
2004-01-09 13:43:49 +00:00
Ian Dowse
6e3aaeb2d7 Define _PATH_MKSNAP_FFS and use it in dump(8) instead of assuming
that mksnap_ffs(8) can be found using the current $PATH.

Reviewed by:	mckusick
2004-01-04 17:17:46 +00:00
Jordan K. Hubbard
3a5c252064 Now I understand what Bruce was getting at - -1 can be parsed as two
tokens, so it does indeed need to be parenthesized.  Duh.  Sometimes
it can stare you right and the face and you still don't see it.  Thanks, bde.
2003-12-18 10:41:39 +00:00
Jordan K. Hubbard
f415f20926 Adjust in response to various bits of brucification:
1) Fix style issues in comments.
2) Properly namespaceify changes
3) Appropriate sectioning of changes

Not changed: parenthesis around macro rvalue.  That would make the additions
inconsistent with the other entries there, merely a different style violation
rather than a clear and obvious improvement so I'm going to have to disagree
with the judges on that one.  If someone wishes to adjust *all* the rvalues
to conform to fully parenthesized marco rule, that would be both consistent
and reasonable but that's beyond the scope of the changes I wish to make at
this time.
2003-12-18 07:42:08 +00:00
Jordan K. Hubbard
0bdc49c676 OK, someone was tab happy in this file. A tab after #define?! OK, fine,
I'll keep the same style regardless of the wisdom of it. :)
Clarified by:	eivind
2003-12-17 10:54:05 +00:00
Jordan K. Hubbard
2c09e9e3a4 Correct inexplicable tab smash.
Noticed by:	Nate Lawson <nate@root.org>
2003-12-17 08:03:18 +00:00
Jordan K. Hubbard
dabcf42ff1 Conformance: Add REG_ENOSYS (see http://www.opengroup.org/onlinepubs/007904975/basedefs/regex.h.html) 2003-12-17 02:56:28 +00:00
Jordan K. Hubbard
be4a5e8916 Conformance: Define FNM_NOSYS (see http://www.opengroup.org/onlinepubs/007904975/basedefs/fnmatch.h.html) 2003-12-17 02:54:29 +00:00
David E. O'Brien
a5b5101f5e Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr
as these ioctl's aren't MD.  This also means they are installed in
/usr/include/dev/bktr now.  Also provide compatability wrappers for
where these headers lived in 4.x.
2003-12-08 07:22:42 +00:00
David E. O'Brien
f2cdd77eff Fix sort order. 2003-12-08 06:41:28 +00:00
Marcel Moolenaar
12eb46c8bb Change the definition of NULL on ia64 (for LP64 compilations) from
an int constant to a long constant. This change improves consistency
in the following two ways:
1. The first 8 arguments are always passed in registers on ia64, which
   by virtue of the generated code implicitly widens ints to longs and
   allows the use of an 32-bit integral type for 64-bit arguments.
   Subsequent arguments are passed onto the memory stack, which does
   not exhibit the same behaviour and consequently do not allow this.
   In practice this means that variadic functions taking pointers
   and given NULL (without cast) work as long as the NULL is passed
   in one of the first 8 arguments. A SIGSEGV is more likely the
   result if such would be done for stack-based arguments. This is
   due to the fact that the upper 4 bytes remain undefined.
2. All 64-bit platforms that FreeBSD supports, with the obvious
   exception of ia64, allow 32-bit integral types (specifically NULL)
   when 64-bit pointers are expected in variadic functions by way of
   how the compiler generates code. As such, code that works correctly
   (whether rightfully so or not) on any platform other than ia64, may
   fail on ia64.

To more easily allow tweaking of the definition of NULL, this commit
removes the 12 definitions in the various headers and puts it in a
new header that can be included whenever NULL is to be made visible.

This commit fixes GNOME, emacs, xemacs and a whole bunch of ports
that I don't particularly care about at this time...
2003-12-07 21:10:06 +00:00
Murray Stokely
a298e0ba03 Add support for timeout: and attempts: resolver options.
Submitted by:	Paul Vixie <paul@vix.com> / ISC
MFC After:	1 week
2003-12-07 12:32:24 +00:00
Scott Long
90768c55d4 Install UDF header files to unbreak /sbin building when /sys is not present.
Submitted by:	imura@ryu16.org
2003-11-22 06:08:59 +00:00
Bruce M Simpson
2554d76f85 Add the userland part of the NET_RT_IFMALIST sysctl MIB. A new function,
getifmaddrs(), is added to retrieve current multicast group memberships.

Reviewed by:	harti
2003-11-14 18:53:22 +00:00
Daniel Eischen
8b813ec31c Add the pthread_atfork() prototype.
Reviewed by:	davidxu
2003-11-04 20:10:15 +00:00
Poul-Henning Kamp
347fb1d46e Add a new flag to vis(3): VIS_GLOB which encodes the glob(3) magic
characters '*', '?' and '['.
2003-10-30 10:40:49 +00:00
Peter Wemm
7921179035 *blush*. stdhash.h != strhash.h
Sorry folks.
2003-10-29 00:32:25 +00:00
Peter Wemm
dc196afb2e Don peril sensitive (ie: bikeshed sensitive) sunglasses and quietly
send strhash(3) off to sleep with the fishes.  Nothing in our tree uses it.
It has no documentation.  It is nonstandard and in spite of the filename
strhash.c and strhash.h, it lives in application namespace by providing
compulsory global symbols hash_create()/hash_destroy()/hash_search()/
hash_traverse()/hash_purge()/hash_stats() regardless of whether you
#include <strhash.h> or not.  If it turns out that there is a huge
application for this after all, I can repocopy it somewhere safer and
we can revive it elsewhere.  But please, not in libc!
2003-10-28 22:36:54 +00:00
Peter Wemm
06f544b2d6 Argh. Forward declare some structs rather than increase include file
dependencies.
2003-10-26 16:35:11 +00:00
Peter Wemm
862c47dc3b Prototype yp_maplist() 2003-10-26 05:27:14 +00:00
Hajimu UMEMOTO
ff6322f828 style.
Reported by:	bde
2003-10-24 06:53:12 +00:00
Hajimu UMEMOTO
fdf361fd38 oops, EAI_NONAME is not EAINONAME. 2003-10-24 03:49:38 +00:00
Hajimu UMEMOTO
56f88dba4c workaround to have backward compatibility for EAI_NODATA.
it will be removed on 23 Apr 2004.

Submitted by:	terry
2003-10-23 17:54:17 +00:00
Hajimu UMEMOTO
27f9f41942 oops, I forget to diable EAI_ADDRFAMILY and EAI_NODATA. 2003-10-23 16:11:46 +00:00
Hajimu UMEMOTO
d24cb2490d stop use of NI_WITHSCOPEID. it was deprecated.
Obtained from:	KAME
2003-10-21 20:11:47 +00:00
David Xu
c095b4a999 Add code to support pthread spin lock.
Reviewed by: deischen
2003-09-09 06:57:51 +00:00
David Xu
407c3de522 Add small piece of code to support pthread_rwlock_timedrdlock and
pthread_rwlock_timedrwlock.
2003-09-06 00:07:52 +00:00
David Xu
2ab83179b5 Add code to support barrier synchronous object and implement
pthread_mutex_timedlock().

Reviewed by: deischen
2003-09-04 14:06:43 +00:00
Alexander Kabaev
fefa0fd51d Add a new machine independent varargs.h and use it as a central place
to announce the demise of varargs support in GCC versions 3.3+ and to
direct users to stdarg.h instead.

Fall back to machine/varargs.h for older GCC versions.
2003-09-01 03:28:25 +00:00
Garrett Wollman
73282a3b6c Update gethostname() prototype to match source and standard. 2003-08-19 20:39:49 +00:00