Commit Graph

8260 Commits

Author SHA1 Message Date
Mike Makonnen
4e3c587d23 Bump up the maximum number concurrent threads on x86. 2004-02-01 15:33:01 +00:00
David Schultz
01623eaad2 Merge vfscanf.c,v 1.35. 2004-01-31 23:18:53 +00:00
David Schultz
ff81345642 Fix the handling of negative hexadecimal numbers in integer formats.
Note that this bug is unrelated to recent work in this area; it seems
to have been present since revision 1.1.

Obtained from:	NetBSD
2004-01-31 23:16:09 +00:00
Andrey A. Chernov
41ddc53bca LC_ALL not always take priority over other LC_*
Obtained from:  NetBSD
PR:             62047
2004-01-31 19:15:32 +00:00
Daniel Eischen
baadb27d98 Correct the link for the profiling library. 2004-01-31 17:00:04 +00:00
Marcel Moolenaar
a99e07ba17 Now that libpthread is the default threading library, remove the
compatibility link from libc_r to libpthread (previously a link
from libc_r to libkse).
2004-01-31 05:05:45 +00:00
Marcel Moolenaar
b60c2339a9 In Write_Disk(), fix the non-error case where we returned to the
caller without closing the disk device and freeing allocated
memory. Not closing the disk device prevents GEOM from retasting
after spoiling.

Pointy hat: marcel
2004-01-30 20:52:54 +00:00
Daniel Eischen
bd224d495e Change libkse back to libpthread and make it the default
thread library for i386, amd64, and ia64.  For alpha
and sparc64 the library is not changed and remains libkse,
and links are installed so that libpthread -> libc_r.

The gcc -pthread option will be changed in a separate
commit so that it links to -lpthread instead of -lc_r.

Approved by:	re@
2004-01-30 12:13:17 +00:00
Mike Makonnen
1baa64733c I update the rwlock code in libthr to be more standards compliant and
what do I get for my troubles? libc breaks offcourse!

Reimplement a hack (in libthr) that allows libc to use
rwlocks without initializing them first. The hack was reimplemented
so that only a private libc version of the rwlock locking functions
initializes an uninitialized rwlock. The application version will
correctly fail.
2004-01-29 12:03:17 +00:00
Mike Makonnen
98a11db62d When suspending a thread if the timeout was very short or
the system call got interrupted and the absolute timeout is
converted to a relative timeout, it may happen that we get a
negative number. In such a case, simply set the timeout to
zero so that if the event that the thread wants to wait for has
happened it can still return successfully, but if it hasn't
happened then the thread doesn't suspend indefinitely. This should
fix certain applications (including mozilla) that seem to hang
indefinitely sometimes.

Noticed and debugged by: Morten Johansen <root@morten-johansen.net>
2004-01-29 09:44:36 +00:00
Andrey A. Chernov
e6e9fb749a Add reference to environ(7) 2004-01-29 09:27:24 +00:00
Marcel Moolenaar
94635227fd Fix an uninitialized variable bug that caused write_pmbr() to bogusly
return an error value that made Write_Disk() abort.  While on the
subject, improve the initialization of the error variable in read_gpt()
and update_gpt() even though nothing was broken there.
2004-01-28 03:38:25 +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
Ruslan Ermilov
254ae03ba3 Increment WARNS. 2004-01-28 00:11:42 +00:00
Maksim Yevmenkin
8f63fe015f The report size is not a local item, so don't clear it when clearing local items.
PR:	misc/58971
Reviewed by:	imp (mentor), mdodd
Obtained from:	NetBSD
2004-01-28 00:05:22 +00:00
Ruslan Ermilov
d15ff41778 - Added three new interfaces, NgAllocRecvMsg(), NgAllocRecvAsciiMsg(),
and NgAllocRecvData(), that dynamically allocate buffer for a binary
  message, an ascii message, and a data packet, respectively.  The size
  of the allocated buffer is equal to the socket's receive buffer size
  to guarantee that a message or a data packet is not truncated.

- Get rid of the static size buffer in NgSendAsciiMsg().

OK'ed by:	archie, julian
2004-01-27 20:25:14 +00:00
Ruslan Ermilov
bbc5b4d9c5 mdoc(7) cleanup. 2004-01-27 19:24:53 +00:00
Ruslan Ermilov
430b8c1b05 Fixed memory leak in NgSendAsciiMsg(). 2004-01-27 18:38:22 +00:00
Yoshihiro Takahashi
109479ce29 Fixed pc98 partition type. 2004-01-27 15:25:33 +00:00
Dag-Erling Smørgrav
3a59e89e73 Implement pam_sm_close_session().
PR:		bin/61657
Submitted by:	Joe R. Doupnik <jrd@cc.usu.edu>
2004-01-26 19:28:37 +00:00
Eivind Eklund
93a876df31 Xref kqueue and poll 2004-01-26 15:20:16 +00:00
Eivind Eklund
1633f3b5a2 Xref kqueue 2004-01-26 15:19:54 +00:00
Maksim Yevmenkin
6c7f392438 Cleanup CFLAGS in libsdp(3) Makefile
Connect sdpd(8) to the build

Reviewed by: ru, imp (mentor)
2004-01-25 21:33:59 +00:00
Dag-Erling Smørgrav
09e0653941 I don't normally use my middle name, so remove it from attributions in
man pages (though not from copyright notices).  While I'm here, add email
addresses where appropriate.
2004-01-25 11:39:42 +00:00
Andrey A. Chernov
81ccc5779c Describe EOVERFLOW case 2004-01-25 06:24:08 +00:00
Hartmut Brandt
0543f20b95 Rename the MIBS makefile variable to BMIBS so that it does not conflict
with the environment variable MIBS that is used by net-snmp.
2004-01-24 20:12:30 +00:00
Martin Blapp
09c37f5de6 When writing/reading longs use explicit 32bit temporary values.
MFNetBSD rev. 1.15 + rev 1.16

PR:		bin/60901
Submitted by:	Logan Gabriel <gersh@sonn.com>
Obtained from:	NetBSD
2004-01-24 01:23:30 +00:00
David Schultz
7b7e350998 Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()
and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs*
to be char arrays rather than wchar_t arrays.

In collaboration with:	tjr
2004-01-23 22:48:16 +00:00
Hartmut Brandt
b6a6dd1872 Create the OID and tree files while building the modules and the daemon
instead of creating them by hand and storing them in the CVS tree. Add
gensnmptree to the bootstrap tools (it is used to generated these files).
This simplifies the update procedure.

Submitted by:	ru
2004-01-23 16:22:49 +00:00
Hartmut Brandt
f1bd897915 Style: remove an empty line. 2004-01-23 11:01:57 +00:00
Daniel Eischen
39edba076e Initialize the (i386) frame pointer when setting up a thread
context.

Submitted by:	Marc Olzheim <marcolz@stack.nl>
Tested by:	Marc Olzheim <marcolz@stack.nl>
2004-01-22 19:15:08 +00:00
Mike Makonnen
dec04f43d9 o Implement the pthread_spin_* functions in libthr.
o Man pages
2004-01-22 15:31:56 +00:00
John Baldwin
fb6b710c39 Clean up error handling in libstand filesystem code to be more consistent:
- bzipfs and gzipfs now properly return errno values directly from their
  read routines rather than returning -1.
- missing errno values on error returns for the seek routines on almost
  all filesystems were added.
- fstat() now returns -1 if an error occurs rather than ignoring it.
- nfs's readdir() routine now reports valid errno values if an error or
  EOF occurs rather than EPERM  (It was just returning 0 for success and
  1 for failure).
- nullfs used the wrong semantics for every function besides close() and
  seek().  Getting it right for close() appears to be an accident at that.
- read() for buffered files no longer returns 0 (EOF) if an error occurs,
  but returns -1 instead.
2004-01-21 20:12:23 +00:00
Peter Grehan
864dbc1065 Include <stdlib.h> to get abort() prototype. 2004-01-21 05:04:25 +00:00
Peter Grehan
b12b51fb53 Updated manh shift constant type to 'ULL' for PPC to fix
shift-too-large compile error

reviewed by: das
2004-01-21 04:51:50 +00:00
Maksim Yevmenkin
07be7a6c2e Import sdpd(8) sources. This is Bluetooth Service Discovery Protocol daemon.
Extend libsdp(3) API to allow service registration and removal.
Fix uninitialized variable bug in sdpcontrol(8).

Reviewed by: imp (mentor)
No objection: ru
2004-01-20 20:48:26 +00:00
Ruslan Ermilov
8900255ef4 The <bsd.files.mk> API seems the best to use here. 2004-01-20 13:31:35 +00:00
David Schultz
60ce8b0e07 Discard the first 1024 bytes of output as suggested by
http://citeseer.nj.nec.com/fluhrer01weaknesses.html and
http://citeseer.nj.nec.com/531224.html .

PR:		61126
Submitted by:	Jeff Ito <jeffi@rcn.com>
2004-01-20 04:22:47 +00:00
David Schultz
307649e2f3 Use 'uint32_t' instead of 'long' when a 32-bit integer is intended.
This results in no functional change, aside from fixing a data
corruption bug on LP64 platforms.  The code here could still use a
significant amount of cleanup.

PR:		56502
Submitted by:	hrs (earlier version)
2004-01-20 03:02:18 +00:00
David Schultz
f4d140366a Simplify mpool_get() and mpool_write() by using pread() and pwrite()
instead of lseek()/_read() and lseek()/_write().

PR:		bin/54276
Submitted by:	<dnelson@allantgroup.com>
2004-01-20 00:40:35 +00:00
Ruslan Ermilov
ec56136935 Clean up makefiles.
Reviewed by:	harti
2004-01-19 19:26:02 +00:00
Jacques Vidrine
8e1b0bc697 libc is now WARNS=2 clean with the exception of the gdtoa bits (which
are now not built with warnings enabled at all).
2004-01-19 16:16:53 +00:00
Jacques Vidrine
07a6d1d3f2 Add prototypes for the three syscall stubs that are invoked here,
in order to quiet warnings.
2004-01-19 16:14:58 +00:00
Mike Makonnen
1c6841ae78 Refactor _pthread_mutex_init
o Simplify the logic by removing a lot of unnecesary nesting
	o Reduce the amount of local variables
	o Zero-out the allocated structure and get rid of
	  all the unnecessary setting to 0 and NULL;

Refactor _pthread_mutex_destroy
	o Simplify the logic by removing a lot of unnecesary nesting
	o No need to check pointer that the mutex attributes points
	  to. Checking passed in pointer is enough.
2004-01-19 15:00:57 +00:00
Mike Makonnen
c40bafac85 Implement reference counting of read-write locks. This uses
a list in the thread structure to keep track of the locks and
how many times they have been locked. This list is checked
on every lock and unlock. The traversal through the list is
O(n). Most applications don't hold so many locks at once that
this will become a problem. However, if it does become a problem
it might be a good idea to review this once libthr is
off probation and in the optimization cycle.
This fixes:
	o deadlock when a thread tries to recursively acquire a
	  read lock when a writer is waiting on the lock.
	o a thread could previously successfully unlock a lock it did not own
	o deadlock when a thread tries to acquire a write lock on
	  a lock it already owns for reading or writing [ this is admittedly
	  not required by POSIX, but is nice to have ]
2004-01-19 14:51:45 +00:00
Poul-Henning Kamp
a9b19289e6 add cross-reference to clock_gettime(2) 2004-01-19 12:41:39 +00:00
David Schultz
e18c6616e2 Bring the *printf(3) documentation up to date with the code:
- Update and improve the documentation for %[aA]
  o Like %[eE], %[aA] may round the result if a precision is specified.
  o Grammar police: Fix a split infinitive.
  o The FreeBSD implementation does better than the minimum required
    by C99 (literal translation of the mantissa).  The digit before
    the hexadecimal-point is never 0 unless the number itself is 0.
  o Clarify that the exponent field represents a decimal exponent of 2.
  o Discuss the fact that multiple valid representations are possible.
  o Remove the entry in the BUGS section claiming that %[aA] is not
    implemented.

- Remove the entry in the BUGS section claiming that the ' flag for
  printing thousands separators is unimplemented for floating-point.

- Remove the entry in the BUGS section claiming that the L modifier
  reduces the precision to "double" before conversion.
2004-01-19 08:28:30 +00:00
Philippe Charnier
c4fe9d664a add missing endusershell() call. Original version was incorrect.
PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
2004-01-18 21:33:25 +00:00
Ruslan Ermilov
bb96dfc53a Deal better with the crypto version of the PAM library that goes
on the release media -- only put what is different in the crypto
version compared to the base version.  This reduces PAM entries
in /usr/lib in the "crypto" distribution to:

	libpam.a
	libpam.so@
	libpam.so.2
	pam_krb5.so@
	pam_krb5.so.2
	pam_ksu.so@
	pam_ksu.so.2
	pam_ssh.so@
	pam_ssh.so.2

The libpam.so* is still redundant (it is identical to the "base"
version), but we can't set DISTRIBUTION differently for libpam.a
and libpam.so.

(The removal of libpam.so* from the crypto distribution could be
addressed by the release/scripts/crypto-make.sh script, but then
we'd also need to remove redundant PAM headers, and I'm not sure
this is worth a hassle.)
2004-01-18 14:58:07 +00:00
David Schultz
8f59277300 Implement __hdtoa() and __hldtoa() and enable printf() support for %a
and %A, which print floating-point numbers in hexadecimal.
2004-01-18 10:32:49 +00:00