Commit graph

40 commits

Author SHA1 Message Date
David van Moolenbroek 29346ab043 PM: add support for wait4(2)
This patch adds support for the wait4 system call, and with that the
wait3 call as well.  The implementation is absolutely minimal: only
user and system times of the exited child are returned (with all other
rusage fields left zero), and there is no support for tracers.  Still,
this should cover the main use cases of wait4.

Change-Id: I7a04589a8423a23990ab39aa38e85d535556743a
2015-09-29 18:15:28 +00:00
David van Moolenbroek 7c48de6cc4 Resolve more warnings
Change-Id: Ibc1b7f7cd45ad7295285e59c6ce55888266fece8
2015-09-23 12:04:58 +00:00
Kaustubh Kelkar 989398b447 Importing bin/domainname utility
Change-Id: Iaf2067296195d2d55b93d00ac593b431572ca4cd
2015-07-28 21:56:19 +00:00
Jean-Baptiste Boric 1facb0487c libc: add posix_spawn family of functions
The implementation is taken from newlib (BSD licensed) and test84 is based
on NetBSD's t_spawn.c

Change-Id: Ia4e9dd5204a0b4ef241a451978057e11fb29e3d6
2015-07-28 14:18:03 +00:00
David van Moolenbroek 0184c63535 libc: fix sysctl(3) error code
All unimplemented sysctl calls would return 2 instead of -1.

Change-Id: Ib486a03dc93969e646e4e11d890dc46855d790c4
2015-07-24 23:12:36 +00:00
Ben Gras b329f2c73b libc: FTS support for dynamic inode numbering
Edited by Lionel Sambuc and David van Moolenbroek.

Change-Id: I29d6383499d8c0524f86f9dcec701aff35ce8a43
2015-06-29 10:58:08 +00:00
David van Moolenbroek 5d259c7f93 libc: enable setproctitle(3)
Change-Id: I31bbc5d960c60f7347424ce3d8f4bce89b396339
2014-10-03 10:01:03 +00:00
Ben Gras bad58c9c51 merge libminlib with libc
Change-Id: I79cc4ea90c378a1da3dac16487b53034953827a7
2014-08-28 18:49:19 +02:00
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00
Lionel Sambuc 4684ddb6aa LLVM Minix changes
- import libcxx
 - reduce targets to the one when compiled as a tools

Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
2014-07-28 17:05:59 +02:00
David van Moolenbroek 69cba46141 libc: make ttyname(3) use devname(3)
There was an off-by-one in the old MINIX-specific implementation,
which caused ttyname(3) to fail at random. Since we now have a working
devname(3), there is no need for MINIX-specific code anymore here.

Change-Id: I27d8b6c4f66c84f383156ed494b740d071af02a7
2014-07-28 17:05:53 +02:00
Lionel Sambuc ee2f1ee4cd Message type for PM_WAITPID
Change-Id: Ic2637a30418b9c780504f21a93ee80cef09ee1f2
2014-07-28 17:05:35 +02:00
Morgawr 91c835edc2 added sethostname syscall with proper error checks
Change-Id: I4b4e0a7c4035e19d5843b86ee1f714096adcecd2
2014-07-28 17:05:24 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras 81473dbba0 <vmparam.h>
Change-Id: I941ea3111703ed089bfdaf87d26158ab8697a80d
2014-03-03 20:47:04 +01:00
Lionel Sambuc afc1f71188 include/paths.h: merged
Change-Id: I5e2aa0bc99a596f82ef4224f22623bcb83cb98b5
2014-03-03 20:47:01 +01:00
Ben Gras a06e2ab395 big <utmp.h>-inspired netbsd switch
import/switch of:
init, getty, reboot, halt, shutdown, wall, last

changes:
	. change reboot() call to netbsd prototype and args
	. allows pristine <utmp.h>
	. use clean <sys/reboot.h> instead of <minix/reboot.h>
	. implement TIOCSCTTY for use by getty so getty can get
	  controlling terminal from init's child(ren)
	. allow NULL envp for exec

Change-Id: I5ca02cb4230857140c08794bbfeba7df982c58a3
2014-03-01 09:05:02 +01:00
David van Moolenbroek 24ec0d73b5 Clean up interface to PM and VFS
- introduce new call numbers, names, and field aliases;
- initialize request messages to zero for all ABI calls;
- format callnr.h in the same way as com.h;
- redo call tables in both servers;
- remove param.h namespace pollution in the servers;
- make brk(2) go to VM directly, rather than through PM;
- remove obsolete BRK, UTIME, and WAIT calls;
- clean up path copying routine in VFS;
- move remaining system calls from libminlib to libc;
- correct some errno-related mistakes in libc routines.

Change-Id: I2d8ec5d061cd7e0b30c51ffd77aa72ebf84e2565
2014-03-01 09:05:01 +01:00
David van Moolenbroek 4d4e70daaa PM: remove obsolete ALARM, PAUSE, TIMES calls
NetBSD libc implements these as wrappers around setitimer(2),
sigsuspend(2), and getrusage(2), respectively.

Change-Id: I0c5e725b3e1316bddd3a3ff7ef65d57d30afd10d
2014-03-01 09:04:59 +01:00
Ben Gras 6c8f7fc3ba netbsd dirent.h, import sys/sys *.h, mfs cleanup
. add all sys/sys headers not already present to help compiling
	. take netbsd dirent.h and struct dirent; main result is
	  introducing d_type and d_namlen that have to be set by getdents()
	  in all FS code implementing it
	. d_off is gone
	. alignment of the struct has become 8 bytes instead of 4
	. remove _MAX_BLOCK_SIZE, _MIN_BLOCK_SIZE, _STATIC_BLOCK_SIZE
	. libminlib: cleanup unused yet duplicate code
	. mfs: throw out the long-broken v1, v2 support
	. new test for dirent contents filled by getdents()

Change-Id: I1459755c7ba5e5d1c9396d3a587ce6e63ddc283e
2014-03-01 09:04:59 +01:00
David van Moolenbroek d266a94fea Enable devname(3)
There is no support for a device name database yet, so this call is
expected to be fairly slow.

Change-Id: I73aa5f267e2b6921b7d3bbdcc4beac463931132c
2014-03-01 09:04:53 +01:00
David van Moolenbroek 430c2113c7 Enable getmntinfo(3)
Change-Id: Ida9b0660471bb9fde3cdca6c9b9fd9e94341e02f
2014-02-18 11:25:02 +01:00
Thomas Cort 1e69cb63f4 Importing usr.bin/nl
* Add _SC_LINE_MAX to unistd.h (value of 15 from NetBSD).
 * Add _SC_LINE_MAX case to sysconf(3) in libc.
 * usr.bin/nl itself required no Minix specific changes.

Change-Id: I10f056ccdf4f212beb1272f735f41303e5036c05
2013-10-14 18:06:05 -04:00
Thomas Veerman 2a8a99cc6a libc: revert inadvertent removal of O_CLOEXEC #ifndefs
Change-Id: I15005181388280363f7aee546bd2ecc0cd5b37e6
2013-07-12 18:39:12 +02:00
Ben Gras 9178749e13 libc syslog, syslogd, logger, uds fixes
changes necessary for libc syslog() using a unix domain socket.

	. libc syslog: don't use send() connect() for unix
	  datagram sockets, minix wants write() and ioctl()
	. syslogd: listen on _PATH_LOG unix domain socket
	. logger: warnings fixes
	. pfs: make uds dgram socket type nonblocking so
	  syslog() doesn't block
	. vfs: add sanity check for empty fd in unpause()

Change-Id: Ied136c6fe0cc288f5a53478f1eebccc1ab1f39fb
2013-06-12 07:04:52 +00:00
Antoine Leca 9131e98a7d utimens(2) system call
Variant of utime(2) with struct timespec (with ns precision)
instead of time_t values; also allows for tv_nsec members
the values UTIME_NOW (force update to current time) or
UTIME_OMIT (allow to set either atim or mtim independently.)

Provides a superset of utimes(2), futimes(2), lutimes(2),
and futimens(2).
Provides the same subset of utimensat(2) as does NetBSD 6.
Also import utimens() and lutimeNS() from NetBSD-current.
2013-04-12 18:55:39 +00:00
Thomas Veerman 39fad09a94 libc: drop Minix popen and use NetBSD's
Change-Id: I56f253d855671a6e1c8d53c7383107565164ab8d
2013-02-28 10:08:54 +00:00
Thomas Veerman fd610ba1b0 VFS: add ability to open files O_CLOEXEC
.adjust libc to make use of it (undo __minix diff)

Change-Id: I90a1aa219fcd1b12b6bc60e72176f326eac8184a
2013-02-28 10:08:53 +00:00
Ben Gras 95513e73da opendir change: refinement
Change-Id: I90cc6929c9e7678da8e200688dcd40441efe030f
2013-02-08 23:09:21 +00:00
Ben Gras 4505b4a30a add opendir alias
Change-Id: Ib121e763bac7bea44a2f2533c454ff7d9361dc8d
2013-02-08 21:40:57 +00:00
Lionel Sambuc 96836647f8 Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
Lionel Sambuc 0ac803292e Fix warnings trivial warnings.
Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
2013-01-14 11:44:31 +01:00
Lionel Sambuc f14fb60209 Libraries updates and cleanup
* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
2013-01-14 11:36:26 +01:00
Ben Gras 017ce5a503 libc, libutil: remove compat hacks 2013-01-08 15:47:37 +00:00
Lionel Sambuc 9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00
Thomas Veerman f93afa00e9 Remove MINIXSRCDIR and use NETBSDSRCDIR
NETBSDSRCDIR is used all over the place anyway, and this reduces
our diff with NetBSD a little.
2012-06-18 10:53:35 +00:00
Ben Gras 204ae72525 retire _ANSI and <minix/ansi.h> 2012-03-25 21:58:27 +02:00
Ben Gras db242ed39d retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID 2012-03-25 21:58:20 +02:00
Ben Gras 7336a67dfe retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00