Commit graph

53 commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen
29b14378e8 Fix usleep(2) sleeping 1000x too much regression. 2021-06-23 22:09:57 +02:00
Jonas 'Sortie' Termansen
4daedc31f7 Fix handling of overflow and non-canonical values in timespec APIs.
Support zero relative and absolute times in the timer API.
2021-06-22 21:48:27 +02:00
Jonas 'Sortie' Termansen
11be0007b8 Remove ENOUSER and ENOGROUP.
The <pwd.h> and <grp.h> family of functions are supposed to return
nothing with no error set if there is no matching entry.
2021-05-10 23:26:31 +02:00
Jonas 'Sortie' Termansen
9380ed82ac Fix typo in getentropy(2). 2018-02-04 13:39:37 +01:00
Jonas 'Sortie' Termansen
db7182ddc3 Add support for sessions.
This change refactors the process group implementation and adds support
for sessions. The setsid(2) and getsid(2) system calls were added.

psctl(2) now has PSCTL_TTYNAME, which lets you get the name of a process's
terminal, and ps(1) now uses it.

The initial terminal is now called /dev/tty1.

/dev/tty is now a factory for the current terminal.

A global lock now protects the process hierarchy which makes it safe to
access other processes. This refactor removes potential vulnerabilities
and increases system robustness.

A number of terminal ioctls have been added.

This is a compatible ABI change.
2016-11-23 22:30:47 +01:00
Jonas 'Sortie' Termansen
2a6a246ff4 Remove getdomainname(2). 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen
05282c86d7 Fix fchownat(2) system call ABI on x86.
This system call has five arguments, of which one is a 64-bit uid_t, and
another is a 64-bit gid_t, which means that 7 registers are needed. However,
x86 only has 5 registers available for system calls. Wrap the system call
with a structure like with mmap(2).
2016-03-26 23:28:36 +01:00
Jonas 'Sortie' Termansen
2b72262b4f Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.

All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.

All imported code from other projects is compatible with this license.

All GPL licensed code from other projects had previously been removed.

Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-05 22:21:50 +01:00
Jonas 'Sortie' Termansen
af40496ffb Convert utils to C. 2016-03-03 23:02:24 +01:00
Jonas 'Sortie' Termansen
01b59c1947 Convert libc to C. 2016-03-03 23:02:23 +01:00
Jonas 'Sortie' Termansen
624ceff900 Add _PC_NAME_MAX support. 2016-01-26 21:17:08 +01:00
Jonas 'Sortie' Termansen
fbfe159046 Add crypt_checkpass(3) and crypt_newhash(3). 2016-01-09 02:54:51 +01:00
Jonas 'Sortie' Termansen
5915e2cd14 Add closefrom(2). 2015-08-26 14:01:25 +02:00
Jonas 'Sortie' Termansen
b2f1c72cc7 Remove _WANT_ENVIRON remnants. 2015-02-08 22:58:32 +01:00
Jonas 'Sortie' Termansen
56267517ec Update ttyname_r to current coding conventions. 2015-02-08 22:58:32 +01:00
Jonas 'Sortie' Termansen
1bc2650413 Fix <sys/syscall.h> inclusion style. 2015-02-06 14:56:36 +01:00
Jonas 'Sortie' Termansen
8322d5f82c Fix getlogin_r memory leak. 2015-02-06 14:56:35 +01:00
Jonas 'Sortie' Termansen
3917f4fee3 Use PWD in get_current_dir_name(3) if correct. 2014-12-04 17:56:47 +01:00
Jonas 'Sortie' Termansen
5143f01b0a Remove sbrk(2).
Note: This is an incompatible ABI change.
2014-12-03 23:55:55 +01:00
Jonas 'Sortie' Termansen
3ad7ab4fc3 Add gethostname(2) and sethostname(2). 2014-12-03 13:58:29 +01:00
Jonas 'Sortie' Termansen
8ce7f2f41f Remove inclusion of <errno.h> from read(2) and write(2). 2014-12-02 18:00:38 +01:00
Jonas 'Sortie' Termansen
d8201c007a Add sysconf(_SC_MONOTONIC_CLOCK). 2014-11-28 15:30:39 +01:00
Jonas 'Sortie' Termansen
e460be7a72 Add getentropy(2). 2014-11-28 13:35:51 +01:00
Jonas 'Sortie' Termansen
3760420fbb Add fpathconf(2). 2014-11-27 01:36:52 +01:00
Jonas 'Sortie' Termansen
f8c5adf20f Add #! support to execve(2). 2014-11-26 21:14:13 +01:00
Jonas 'Sortie' Termansen
3577cb81fe Improve execvpe(3) logic and run shell on ENOEXEC. 2014-11-25 23:52:12 +01:00
Jonas 'Sortie' Termansen
d6365e2da2 Add sysconf(_SC_GETPW_R_SIZE_MAX). 2014-09-25 18:20:00 +02:00
Jonas 'Sortie' Termansen
b4de9e4399 Add sysconf(_SC_GETGR_R_SIZE_MAX). 2014-09-25 18:20:00 +02:00
Jonas 'Sortie' Termansen
76577e69f1 Add execlpe(3). 2014-08-24 14:02:42 +02:00
Jonas 'Sortie' Termansen
30cd318c17 Implement signals.
Note: This is an incompatible ABI change.
2014-07-22 13:25:39 +02:00
Jonas 'Sortie' Termansen
28d3b1245f Fix terminology in exec family. 2014-07-20 15:09:16 +02:00
Jonas 'Sortie' Termansen
874baffd57 Fix wrongly named system call constants. 2014-06-27 15:49:55 +02:00
Jonas 'Sortie' Termansen
4ea6aa710c Add exit_thread(2). 2014-06-12 00:05:40 +02:00
Jonas 'Sortie' Termansen
57cddb5cc2 Fix libc files not including their associated header. 2014-05-16 14:21:13 +02:00
Jonas 'Sortie' Termansen
c6978d7d6e Add getdomainname(2). 2014-03-17 19:22:12 +01:00
Jonas 'Sortie' Termansen
e91cde379a Rewrite getenv(3), setenv(3), unsetenv(3) and clearenv(3). 2014-03-17 19:22:11 +01:00
Jonas 'Sortie' Termansen
f34279cc60 Add ttyname_r(3). 2014-03-17 19:22:11 +01:00
Jonas 'Sortie' Termansen
a0a8ed61d8 Add pipe2(2). 2014-03-17 19:22:11 +01:00
Jonas 'Sortie' Termansen
2e855f4095 Fix buffer overflow in execvpe(3). 2014-03-17 16:59:59 +01:00
Jonas 'Sortie' Termansen
4c1d36fd11 Fix setuid(2) calling sys_getuid rather than sys_setuid. 2014-02-23 14:47:22 +01:00
Jonas 'Sortie' Termansen
478db91c3e Fix setgid(2) calling sys_getgid rather than sys_setgid. 2014-02-23 14:47:22 +01:00
Jonas 'Sortie' Termansen
aa9f642df2 Fix seteuid(2) calling sys_geteuid rather than sys_seteuid. 2014-02-23 14:47:22 +01:00
Jonas 'Sortie' Termansen
3163f4600d Fix setegid(2) calling sys_getegid rather than sys_setegid. 2014-02-23 14:47:21 +01:00
Jonas 'Sortie' Termansen
142b2c66c4 Fix symlinkat(2) calling sys_linkat rather than sys_symlinkat. 2014-02-23 14:47:21 +01:00
Jonas 'Sortie' Termansen
140dfe22fc Fix memory leak in getlogin_r(3). 2014-02-06 00:15:03 +01:00
Jonas 'Sortie' Termansen
f47cb98b97 Fix wrong return type in getpgid(2) implementation. 2013-12-30 20:19:00 +01:00
Jonas 'Sortie' Termansen
500d3bb38b Add symlink(2) and symlinkat(2) stub. 2013-12-19 17:42:08 +01:00
Jonas 'Sortie' Termansen
ca2de62ea7 Use the <pwd.h> API in getlogin_r(3). 2013-12-17 14:30:44 +01:00
Jonas 'Sortie' Termansen
396765eaba Remove getdtablesize(3).
This interface has been replaced with sysconf(_SC_OPEN_MAX). Note that this
implementation currently reports this as 0x10000, but there really is no
such limit in Sortix at this time.
2013-12-17 14:30:43 +01:00
Jonas 'Sortie' Termansen
a212ec0ee3 Split libc/unistd/ioleast.cpp into multiple files. 2013-12-17 14:30:43 +01:00