Commit Graph

1839 Commits

Author SHA1 Message Date
Andrey A. Chernov 2e2d038677 Note that default behaviour (restarting signals) is only for signal(3) 1997-08-13 18:40:57 +00:00
Andrey A. Chernov 71936d097e Handle syscalls error return slightly better 1997-08-13 18:22:41 +00:00
Andrey A. Chernov 3be4b5c3df Back out itimerfix hack since nanosleep1 fixed now
Handle syscalls error return slightly better
1997-08-13 18:13:17 +00:00
Andrey A. Chernov f38ea584f5 Add unsigned char cast to all ctype calls 1997-08-13 13:11:53 +00:00
Andrey A. Chernov aaf9cb20c9 Fix longstanding bug with buffer pointer goes beyoud buffer start
Cause initscr (ncurses) fail in some cases
1997-08-13 01:21:36 +00:00
Andrey A. Chernov 3f121d0aa3 TRACE_VIRTPUT (we don't have it yet) -> TRACE_CHARPUT 1997-08-13 00:12:46 +00:00
Andrey A. Chernov fc0cc5ad9b Rearrange itimerfix loop doing it inside SIGALRM handling section 1997-08-12 19:54:31 +00:00
Andrey A. Chernov b39d66c04a Solve itimerfix() problem completely by using loop in 100000000 secs chunks 1997-08-12 19:47:01 +00:00
Andrey A. Chernov 6d4ff45427 Reflect blocked SIGALRM changes 1997-08-12 19:28:07 +00:00
Andrey A. Chernov 8d7bf613b2 Back out my installation of SIGALRM handler even if it is blocked
and return to previous Peter's variant.
POSIX says that this place is implementation defined and old variant allows
application block SIGALRM and sleep and not be killed by external SIGALRMs.
BTW, GNU sleep f.e. sleeps forever in blocked SIGALRM :-)
1997-08-12 19:14:54 +00:00
Peter Wemm df023a8ef7 Run mkMakefile.sh to regenerate 1997-08-12 18:33:06 +00:00
Andrey A. Chernov bc044b88dd Reflect -current implementations 1997-08-12 17:53:00 +00:00
Andrey A. Chernov 1ddf325cda 1) Make usleep() terminateable by alarm (or ualarm) as supposed
historically
2) Fix end of time loop condition: && -> ||
1997-08-12 17:17:53 +00:00
Andrey A. Chernov fa23b4efb8 Change to reflect -current sleep implementation reality 1997-08-12 16:46:05 +00:00
Andrey A. Chernov d23cc31d85 Make itimerfix hack better: return the time we can't sleep at once 1997-08-12 15:46:05 +00:00
Brian Somers 4fe071a9f7 Fix file descriptor leak.
Submitted by:	Charles Mott <cmott@srv.net>
Identified by:	Gordon Burditt
1997-08-11 22:05:10 +00:00
Steve Price 312ecb009a Default size for FD_SETSIZE is 1024 not 256.
PR:		bin/4177
Submitted by:	Wolfgang Helbig <helbig@MX-BA.Stuttgart.De>
1997-08-11 01:31:30 +00:00
Andrey A. Chernov 84dc22996d Implement canonical locking protocol
Suggested by: joerg
1997-08-10 18:42:39 +00:00
Joerg Wunsch ac77b4810d Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting the
acceptable range for tv_sec to the magic number 100000000 (which at
least ought to be declared in a header file, and explained in the
non-existing man page, as well as in the existing man pages for
nanosleep(2) & Co.).

PR:		bin/4259
1997-08-10 12:16:13 +00:00
Joerg Wunsch 37486f035f Import strptime(3) into libc. We've got permission by Kevin Ruddy to
modify the original `no modifications' copyright message, and i've
included his mail into the source file.

The common localization functions between strptime(3) and strftime(3)
have been broken out into timelocal.[ch].
1997-08-09 15:43:59 +00:00
Joerg Wunsch d76419833c Clean import of strptime(3) onto a vendor branch.
Submitted by:	Powerdog Industries <kevin.ruddy@powerdog.com>
1997-08-09 15:38:14 +00:00
Steve Price febad2fcf4 Observe precedence set by Phillippe Charnier in adding an
rcsid.
1997-08-07 22:28:25 +00:00
Steve Price d46c1a60d3 Remove #if(n)def BSD_4_4_LITE cruft and sccsid -> rcsid. 1997-08-07 15:33:50 +00:00
Andrey A. Chernov e1a10354cb Improve weak locking by using flock() 1997-08-05 12:58:02 +00:00
Brian Somers 3efa11bb71 Update to version 2.2. Only the PacketAlias*()
functions should now be used.  The old 2.1 stuff is
there for backwards compatability.
Submitted by:	Charles Mott <cmott@snake.srv.net>
1997-08-03 18:20:03 +00:00
Andrey A. Chernov 9fb4ef6227 Remove collate_range_cmp, was left for temp. backward compatibility 1997-08-03 18:04:39 +00:00
John Polstra 7e7344e2f4 Implement dlsym(RTLD_NEXT, symbol). 1997-08-02 04:56:44 +00:00
Poul-Henning Kamp 89b2f3fd90 Move tcl packages to libdata/pkg 1997-08-01 13:16:40 +00:00
Andrey A. Chernov 89047cedf5 Fix handling of mixed colors+attributes case by merging from ncurses 4.1 1997-07-30 19:04:08 +00:00
Andrey A. Chernov c8a57a4fe5 Fix logical background handling by merging it from ncurses 4.1
No new user-visible functions added
1997-07-30 17:21:39 +00:00
Andrey A. Chernov f1909e979c ifdef out ttytype definition, mytinfo not have it and configure confused 1997-07-30 03:26:37 +00:00
Mike Smith fb4289da2a Improve dependancy behaviour a little more.
This is still pretty disgusting.

Submitted by:	bde
1997-07-28 03:33:04 +00:00
Andrey A. Chernov 885bd2f608 Add getbkgd() macro 1997-07-27 21:01:16 +00:00
Poul-Henning Kamp a3095f3a64 Remove a reference to /c/phk, this should be handled by the magic script
in src/tools.
1997-07-27 20:21:05 +00:00
Mike Smith a39c8cb67d List help.h a a dependancy for editline.c
Use 'beforedepend' instead of '.depend' to hang automatically-generated
headers off.

XXX the latter is bogus without a 'beforeall' target and explicit ordering
of dependancy generation for targets.
1997-07-27 10:47:49 +00:00
John Polstra f9e41842fc Fix a minor typo. It only affects the sparc version. 1997-07-26 03:43:14 +00:00
Peter da Silva dc1f820ee5 Added bounds checking to the example after chasing down someone's
broken code where they'd copied the example basically verbatim and
blew an array. (engage brain before typing 'make')
1997-07-26 00:47:06 +00:00
Poul-Henning Kamp d7df0533d5 Tada!, tcl is now at 8.0b2 I belive. 1997-07-25 19:51:45 +00:00
Mike Smith 194fb96e6a Reorder decomposition of the filename argument for the '-h' flag to
avoid misprocessing in the case where the filename argument contains
more than one period.

Submitted by:	micke@dynas.se (Mikael Hybsch)
1997-07-23 18:23:42 +00:00
Philippe Charnier 9c9cb2bffe = -> ==, strcpy -> strncpy from OpenBSD.
update man page. Add usage().
Obtained from: OpenBSD
1997-07-22 07:39:43 +00:00
Bruce Evans d437803036 Add to CLEANFILES instead of setting it absolutely. Cleaning of *.S and
tags was broken.
1997-07-21 16:02:09 +00:00
David Nugent 78e4c02479 sleep() after sending 'nologin' file to ensure output is drained before
disconnect.
1997-07-19 04:47:05 +00:00
Peter Wemm 925d069aa8 Make sleep() and usleep() "eat" any stray SIGALRM signals during the
lifetime of the call, just like the old implementation did.  Previously,
we were only eating them if the application did not call sleep()/usleep()
with SIGALRM masked.

Submitted by:	ache
1997-07-18 09:48:37 +00:00
Satoshi Asami 85cfd1244c Add appropriate ${DESTDIR} in front of absolute paths. 1997-07-18 07:27:56 +00:00
Satoshi Asami 688034bb93 Add ${DESTDIR} in front of absolute path. 1997-07-18 06:32:39 +00:00
Poul-Henning Kamp e53211ce4d realpath() should break on looped symlinks.
PR:		3911
Reviewed by:	phk
Submitted by:	Shigio Yamaguchi <shigio@wafu.netgate.net>
1997-07-16 11:25:48 +00:00
John Polstra c978fcda00 Kill this file really dead. The default branch was cleared, even
though the file was still on the vendor branch.  I don't know why.
It doesn't look like the cvs-add-on-a-branch bug that we already
know about.
1997-07-15 16:45:50 +00:00
Mike Smith db863ba00b Fix vi-mode searching broken with the NetBSD changes update.
PR:		bin/4064
Submitted by:	Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
1997-07-14 13:21:08 +00:00
Bruce Evans 354fb38542 Fixed minor bugs related to the addition of gammaf.
The major bug, that gamma is documented as really being gamma, is
still unfixed.
1997-07-13 14:45:28 +00:00
Peter Wemm 65b3003d2d kill the undead 1997-07-13 14:26:00 +00:00
Bruce Evans f3acd8dc3c Fixed quoting of backslash. 1997-07-13 07:28:06 +00:00
Peter Wemm dd1d7d1fa0 Add a quick description of sysctlbyname() and link sysctl.3 to
sysctlbyname.3
1997-07-12 11:16:18 +00:00
Peter Wemm 16373facf6 Have sysctlbyname() take a const first arg (the ascii string) 1997-07-12 11:14:30 +00:00
Adam David ccb277de1a execve of interpreter files
reword for grammar/clarity
1997-07-08 18:27:38 +00:00
Peter Wemm e48f3cfbfc Rework previous commit.. I was confused by the number of diffs in the PR
and forgot what I was trying to do originally and accidently zapped
a feature. :-]  The problem is that we are converting a counted buffer in
a malloc pool into a null terminated C-style string.  I was calling realloc
originally to shrink the buffer to the desired size.  If realloc failed, we
still returned the valid buffer - the only thing wrong was it was a tad
too large.  The previous commit disabled this.

This commit now handles the three cases..
1: the buffer is exactly right for the null byte to terminate the
string (we don't call realloc).
2: it's got h.left = 0, so we must expand it to make room. If realloc
fails here, it's fatal.
3: if there's too much room, we realloc to shrink it - a failed realloc
is not fatal, we use the original buffer which is still valid.
1997-07-06 08:42:37 +00:00
Peter Wemm 3c55a3f243 Fix off-by-one error
PR: 3451
Submitted by: Tim Vanderhoek <ac199@hwcn.org>
1997-07-06 07:54:56 +00:00
Bruce Evans 27dceaf5ea Kill histedit.h again. Importing Lite2 brought it back for some reason
(although it hasn't changed).
1997-07-03 04:15:01 +00:00
Bruce Evans 362c392f0b This commit was generated by cvs2svn to compensate for changes in r27180,
which included commits to RCS files with non-trunk default branches.
1997-07-03 03:28:27 +00:00
Bruce Evans 5500fdcd4f Import Lite2's src/lib, except for non-i386 machine-dependent directories,
libc/db, libc/gen/crypt.* and libtelnet.  All affected files except 3
unimportant ones have already left the vendor branch.
1997-07-03 03:28:27 +00:00
Poul-Henning Kamp 25f5c3ba98 Have another go at the malloc-sysv initialization.
PR:		4002
Pointed out by:	bde
1997-07-02 19:33:23 +00:00
Poul-Henning Kamp db7f90903d malloc_sysv used before initialized, reported in PR4002 by
Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>

Various cleanup from Keith Bostic

Reinstate calloc() as a separate funtion, in its own source/object file.
leave the manpage integrated with malloc.3 and friends.  Too many things
were broken in this respect.

PR:		4002
Reviewed by:	phk
Submitted by:	Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Submitted by:	Keith Bostic <bostic@bostic.com>
1997-07-01 18:39:38 +00:00
Jordan K. Hubbard 5e17038f01 Add 64 bit int support to scanf()
PR:		2080
Submitted by:	David Dawes <dawes@rf900.physics.usyd.edu.au>
1997-07-01 17:46:39 +00:00
Jordan K. Hubbard 51e6986086 _err() -> err(). 1997-06-29 00:33:17 +00:00
Peter Wemm 1e7aa4e938 replace the OpenBSD fd_set sizing code with something more efficient.
Only call malloc() if the fd is too big for the compiled in fd_set size,
and don't use calloc either.  This should reduce the impact of conflicts
with private malloc implementations etc.  When using the fd_set on the
stack, only zero what is needed rather than all 1024 bits like FD_ZERO did.
1997-06-28 04:19:52 +00:00
Peter Wemm d2346017f0 Dynamically size fd_set in select rather than fail if too many files
are open.
Obtained from: OpenBSD; by deraadt and dm
1997-06-27 13:00:51 +00:00
Andrey A. Chernov edfa832c6a ctype: portability, sign extension and cleanup fixes 1997-06-27 11:50:56 +00:00
Andrey A. Chernov f76efb86fb Move editrc.5 from MAN3 to MAN5 1997-06-27 11:16:28 +00:00
Peter Wemm fa0913efdb compensate for res_send <-> __res_send changes 1997-06-27 08:35:13 +00:00
Peter Wemm 6c5aff806e Merge in bind-4.9.6 resolver changes. Note that they resolve the
overflow problem differently.
1997-06-27 08:22:03 +00:00
Tor Egge a58930d8a9 Fill in parent process id when reading process information from a
memory dump. This fixes one of the problems noted in PR kern/3581.
1997-06-25 20:56:48 +00:00
Mike Smith e3144c3932 Pull histedit.h out, it lives in /usr/src/include, not here. 1997-06-25 09:49:06 +00:00
Mike Smith 38ec47c346 Add extra test functionality.
Obtained from:	NetBSD
1997-06-25 08:14:45 +00:00
Mike Smith bd5176cb38 Update libedit with changes from NetBSD. Includes history load/save,
some buffer overflow guards and some stylistic cleanups.
Also adds manpages.

Obtained from:	NetBSD
1997-06-25 08:14:24 +00:00
Mike Smith 4ce2d5b5b5 Add stringlist functions from NetBSD. (required for the new ftp(1)
Obtained from:	NetBSD
1997-06-25 08:05:03 +00:00
John Hay 127feebec1 Add tickadj to struct clockinfo, like NetBSD and OpenBSD. 1997-06-24 18:22:44 +00:00
Steve Price 681e5e7a09 Show the real revision date and not the date that this
manpage is being viewed.
1997-06-23 04:03:49 +00:00
Poul-Henning Kamp e3553c0365 Integrate calloc with the rest of the gang.
Various portability and stylistic cleanups.
Kill MALLOC_STATS & the 'D' option.
Fix the 'V' option.
Major overhaul of the man-page.
You milage should not vary.

Reviewed by:	Keith Bostic <bostic@bostic.com>
Submitted by:	Keith Bostic <bostic@bostic.com>
1997-06-22 17:54:27 +00:00
Bill Paul b1d8279802 Hm... wonder how long this has been here.
The logic in get_myaddress() is broken: it always returns the loopback
address due to the following rule:

                if ((ifreq.ifr_flags & IFF_UP) &&
                    ifr->ifr_addr.sa_family == AF_INET &&
                    (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) {

The idea is that we want to select the interface address only if it's
up and it's in the AF_INET family. If it turns uout we don't have
such an interface available, we make a second pass through the loop,
this time settling for the loopback interface. But the logic inadvertently
locks out all cases when loopback == 0, so nothing is ever selected until
the second pass (when loopback == 1).

This is changed to:

                if (((ifreq.ifr_flags & IFF_UP) &&
                    ifr->ifr_addr.sa_family == AF_INET) ||
                    (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) {

which I think does the right thing.

This is yet another bogon I discovered during NIS+ testing; I need
get_myaddress() to work correctly so that the callback code in the
client library will work.
1997-06-20 17:54:11 +00:00
Philippe Charnier 577b61c645 Typo. 1997-06-18 06:26:13 +00:00
David Nugent 0edf29640b Fix infinite loop.
PR: 3878
Submitted by: roman@rpd.univ.kiev.ua
1997-06-16 23:38:01 +00:00
Bill Paul c88fdb1d1d Remember to zero sockaddr_in struct before calling uaddr_to_sockaddr() to
populate it. Not doing this can result in a garbage sockaddr_in, which
will cause connect() to block inside clnttcp_create().
1997-06-15 21:03:32 +00:00
Andrey A. Chernov f2305d469b srandomdev: use stack junk value in the fallback code too 1997-06-15 18:23:19 +00:00
Andrey A. Chernov e9c3c2bc0b Change u_char which require special include to unsigned char 1997-06-14 01:28:59 +00:00
Andrey A. Chernov 83a03b388f Add arc4random() functions from OpenBSD. They are almost same as our
srandomdev(), but can be used inside libraries. random() can't be used
inside libraries because it breaks its possible predictable sequence.
arc4random() is true random as designed, so its usage is library-safe.
Obtained from: OpenBSD
1997-06-14 01:15:41 +00:00
Andrey A. Chernov 96c31b2618 Instead of copying fallback code over and over in each program,
implement (better) falback code inside srandomdev() itself.
Change return type from int to void (binary compatibility surprisely
achieved). Userland code will be changed soon.
1997-06-14 00:14:29 +00:00
David Nugent c2043f40bb Add "break" inadvertently removed in previous update.
PR: 3820
Submitted by: Joseph Stein <joes@spiritone.com>
1997-06-13 22:26:41 +00:00
Andrey A. Chernov a14d48e67b Add MAXHOSTNAMELEN check
Obtained from: OpenBSD
1997-06-13 19:21:54 +00:00
Bill Paul f7cf1c1d14 getnetid() crashes if no /etc/netid file is present (it tries to fclose()
a FILE * handle that wasn't really open).
1997-06-12 18:42:43 +00:00
Poul-Henning Kamp 7c5232c617 Add yet an option, this time on how to deal with malloc(0) and realloc(ptr.0)
Prompted by:	X11 & XFree86
1997-06-12 12:45:45 +00:00
Andrey A. Chernov e728d480d2 Style optimization in newly added POSIX range []] conformance, redo
'for' loop as do...while and remove variable unneded now
1997-06-07 01:33:10 +00:00
Andrey A. Chernov 05a068e60e Add missing FNM_PERIOD check for '[' range
Don't treat !^ as first characters in the range, just as negate sign
[/] never match if FNM_PATHNAME
1997-06-06 22:33:28 +00:00
Andrey A. Chernov e2dbbd9eea 1) Now conforms POSIX.2 2.8.3.2 requirements about []] pattern
2) Treat unclosed [ range in pattern as regular characters (bash style)
1997-06-06 21:48:55 +00:00
John Birrell f4084c0544 Bring back nanosleep from the cold.
The addition of the nanosleep syscall was correctly added to
libc/sys/Makefile so that it is renamed as _thread_sys_nanosleep().
This syscall is one of those that libc_r has to re-implement because
the only behaviour is to block the process. So libc_r just ignores the
fact that a nanosleep syscall exists and goes its own way - as it has
done all along .... and now it does again. And now a simple program
can sleep again. Phew.
1997-06-04 13:03:12 +00:00
John Birrell 1a3a296d21 Fix mutex initialization.
Malloc cannot use pthread_mutex_init() to initialize a mutex because
the mutex initialization process does a malloc!

libc_r internals skip the malloc and assign an initializer to a static
structure and point the opaque type (pthread_mutex_t in this case) to
that structure. This is done on the assumption that the mutex will never
be destroyed. This style of initialization is only valid inside libc_r
because the structure that is assigned is opaque to the user.

This fix allows a simple program to get to main() again. 8-)
1997-06-04 12:55:49 +00:00
Masafumi Max NAKANE d778c2c01b Fix the man page's title (.Dt).
(It has been ``SKEY.ACCESS''.)
1997-06-02 17:24:36 +00:00
Peter Wemm be159dcaf7 Re-activate the nanosleep style using code, but with the signal handling
semantics of the old sleep for compatability with a few decades of expected
side effects.  Apache breaks if we just use nanosleep() for some reason,
here we use a new signanosleep() syscall which is kinda like a hybrid of
sigsuspend and nanosleep..

Reviewed by:  ache (and tested on his apache that was failing when
                    sleep used plain nanosleep)
1997-06-02 16:30:22 +00:00
Julian Elischer 50dab48a5b Submitted by: Whistle Communications (archie Cobbs)
These changes add the ability to specify that a UFS file/directory
cannot be unlinked. This is basically a scaled back version
of the IMMUTABLE flag. The reason is to allow an administrator
to create a directory hierarchy that a group of users
can arbitrarily add/delete files from, but that the hierarchy
itself is safe from removal by them.
If the NOUNLINK definition is set to 0
then this results in no change to what happens normally.
(and results in identical binary (in the kernel)).
It can be proven that if this bit is never set by the admin,
no new behaviour is introduced..
Several "good idea" comments from reviewers plus one grumble
about creeping featurism.

This code is in production in 2.2 based systems
1997-06-02 06:24:52 +00:00
Peter Wemm 5c4722ca2f Add xref to signanosleep(2) 1997-06-01 10:34:39 +00:00
Peter Wemm 34147a3e8f Doc signanosleep, add to links 1997-06-01 09:47:06 +00:00
Peter Wemm 0913e7ce8b Update the sleep(3)/usleep(3) code to use signanosleep(2) if compiled with
-DUSE_NANOSLEEP.  Also, seperate the code for _THREAD_SAFE so that it uses
the simpler threaded nanosleep() call in libc_r..  We don't go to the same
extremes for emulating traditional sleep semantics (ie: eating any SIGALRM
that might happen) which things like apache seem to depend on.
1997-06-01 09:27:03 +00:00