Commit graph

350 commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen
7139de4a53 Add stty(1). 2020-11-25 20:47:19 +01:00
Jonas 'Sortie' Termansen
eb70062331 Fix utils/chown not being gitignored. 2020-10-28 12:47:35 +01:00
Jonas 'Sortie' Termansen
8337947058 Add chown(1). 2020-10-18 00:31:06 +02:00
Jonas 'Sortie' Termansen
6774df5756 Modernize chmod(1). 2020-10-18 00:31:06 +02:00
Jonas 'Sortie' Termansen
11ababec90 Add -h option to ln(1). 2020-04-13 15:00:25 +02:00
Jonas 'Sortie' Termansen
90180a614f Fix ln(1) behavior on empty paths and indentation. 2020-04-12 21:08:57 +02:00
Jonas 'Sortie' Termansen
ff1a90c331 Rewrite ln(1) to be standards compliant. 2020-04-12 00:04:16 +02:00
Jonas 'Sortie' Termansen
8467102662 Fix ls(1) not checking stat_record()'s error correctly. 2018-08-06 23:59:34 +02:00
Jonas 'Sortie' Termansen
db90720c01 Fix code relying on <stdio.h> including <stdarg.h>. 2018-08-06 23:59:34 +02:00
Jonas 'Sortie' Termansen
29555d72bb Fix <fcntl.h> including <sys/stat.h> namespace pollution.
POSIX allows <fcntl.h> to include <sys/stat.h>, but doesn't require it.
There's little reason to do that, since they are separate headers, and
<fcntl.h> just needs the mode_t constants. Fix the code accidentally
relying on <fcntl.h> including <sys/stat.h>. The mode_t constants are now
provided in their own kernel header <sortix/mode.h>.

Additionally fix <sys/stat.h> pulling in all of <sys/types.h>, which is not
allowed by POSIX, which only requires a few types to be declared. Fix the
code accidentally relying on <sys/stat.h> including <sys/types.h>.

Finally fix <dirent.h> pulling in <stdint.h> through <sortix/dirent.h>.

The <sortix/__/dt.h> and <sortix/__/stat.h> headers are no longer required
and their contents have been merged into <sortix/__/dirent.h>.
2018-08-06 23:59:34 +02:00
64f4f5701c Fix typos in sort(1). 2018-04-15 18:06:49 +02:00
Jonas 'Sortie' Termansen
3654b370f1 Add -R option to sort(1). 2018-04-08 20:56:46 +02:00
Jonas 'Sortie' Termansen
a209c89233 Fix POSIX comformance issues in sort(1).
Fix -C disabling checking rather than checking quietly.

Fix sort(1) exiting 1 on certain errors, as POSIX requires sort(1) to only
exit if the input wasn't sorted when -c.

Fix -o opening the output file for truncation before all the input has been
read, as POSIX requires allowing -o to be an input file.

POSIX requires sort(1) to handle input errors by either erroring with no
output, or by erroring and sorting the input read so far. Change the current
behavior of continuing to the next file to simply failing hard on the first
input error.

Don't increment the last line number on the end of the standard input.

Report -c/-C as incompatible with -o.

Exit unsuccessfully on any output errors.

Update to current coding conventions and add documentation while here.
2018-04-08 20:56:46 +02:00
Jonas 'Sortie' Termansen
d1c3433353 Add rw(1). 2018-03-31 00:55:33 +02:00
Jonas 'Sortie' Termansen
0bb865a7d3 Add install(1) -d support. 2017-12-04 23:56:47 +01:00
Jonas 'Sortie' Termansen
724c035c99 Fix failed fix to pstree(1) vertical line drawing character.
The commit 0def94568a switched to the box
drawing light vertical (U+2502) character, but did not fix the now wrong
assumption that the line drawing character encoded to a single byte.
2017-08-20 12:44:34 +02:00
Jonas 'Sortie' Termansen
326e43f3e9 Fix logname(1) not reseting errno before logname(3).
Thanks to ybden for spotting this bug.
2017-07-02 22:09:53 +02:00
Jonas 'Sortie' Termansen
723f8e964c Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
Jonas 'Sortie' Termansen
0def94568a Fix pstree(1) vertical line drawing character. 2017-04-18 23:32:00 +02:00
Jonas 'Sortie' Termansen
10453f0269 Fix uname(1) referencing section 4 and not section 5. 2017-04-12 23:22:09 +02:00
Jonas 'Sortie' Termansen
9613d47496 Fix comma punctuation bugs in manual lists. 2017-03-19 17:34:19 +01:00
Nicholas De Nova
d217621649 Correct manpage spacing per roff(7) convention.
roff(7) dictates that "Each sentence should terminate at the end of an
input line." Instead of doing this, Sortix manpages (incorrectly) used
double-spaces to separate sentences.

Additionally, fix a few small typos.
2017-02-16 14:42:28 -06:00
Nicholas De Nova
eddc4f7407 Document chvideomode(1). 2017-02-13 13:57:16 -06:00
Jonas 'Sortie' Termansen
7de1942803 Only the tty1 login session powers off. 2017-02-12 13:26:26 +01:00
Jonas 'Sortie' Termansen
b86a227f7b Fix unterminated list in pager(1). 2017-02-12 13:11:07 +01:00
Nicholas De Nova
912a5448c5 Document uname(1). 2017-02-05 13:41:07 -06:00
Jonas 'Sortie' Termansen
0bb608b09e Support 8-bit/24-bit color and more escape codes in the graphical console.
The console has gained these escape codes:
 - Set color to any of 256 entries in the palette.
 - Set color to any 24-bit RGB value.
 - Inverse mode.
 - Bold mode.
 - Underline mode.
 - Move cursor to line N.
 - \a is now ignored.

The effectively unused ATTR_CHAR has been removed. Parsing of escape codes
has been improved. The graphical palette has been changed to the tango
colors, which makes Sortix look a bit differently. Some user-space programs
have been changed to use different colors that look better under the new
palette.

Remove const from methods that weren't really const and remove mutable
keyword workaround.
2016-11-27 11:19:03 +01:00
Jonas 'Sortie' Termansen
dc44993465 Add tty(1). 2016-11-23 22:31:41 +01:00
Jonas 'Sortie' Termansen
6ef5a5cee3 Detect whether the terminal has a display and a keyboard layout.
A new ioctl TIOCGDISPLAYS allow detecting which displays the terminal
has associated. The ability to set a keyboard layout can be detected
with tcgetblob kblayout.

Improve the user-space multi-monitor support while here.

The kernel now sets TERM rather than init(8).

This is a compatible ABI change riding on the previous commit's bump.
2016-11-23 22:31:04 +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
3182471881 Switch pager(1) to termios. 2016-11-22 21:36:43 +01:00
Jonas 'Sortie' Termansen
3cfbdb29b5 Fix ls -Ra recursing on dot and dotdot. 2016-11-14 20:47:07 +01:00
Jonas 'Sortie' Termansen
e808ddb62e Fix ps and pstree extra operand not using errx. 2016-11-03 22:10:45 +01:00
Jonas 'Sortie' Termansen
77defc5e24 Add suggestion to use nano(1) if installed. 2016-11-03 22:02:53 +01:00
Jonas 'Sortie' Termansen
df0a99a2d2 Add suggestion to use ed(1) if installed. 2016-10-30 19:56:34 +01:00
Nicholas De Nova
057609ee6c Add logname(1). 2016-10-16 11:27:35 -05:00
Daniel Roskams
207f554b11 Document chroot(8). 2016-10-12 21:51:25 +08:00
Daniel Roskams
27677f2f9a Document unmount(1). 2016-10-11 20:12:48 +08:00
Jonas 'Sortie' Termansen
b5240163b6 Fix newlines in passwd(1) unrecognized option errors. 2016-10-09 23:06:42 +02:00
Jonas 'Sortie' Termansen
169e10ab4b Move chroot(8) and unmount(8) to sbin. 2016-10-09 18:56:52 +02:00
Daniel Roskams
2864faaa6c Document memstat(1). 2016-10-08 10:26:15 +08:00
Daniel Roskams
606385b663 Document pager(1). 2016-10-05 23:01:23 +08:00
Jonas 'Sortie' Termansen
601bed32fb Update cp(1) to current coding conventions. 2016-10-03 20:02:12 +02:00
Jonas 'Sortie' Termansen
a3bc570c1e Remove useless void casts from tr(1). 2016-10-03 20:02:11 +02:00
Jonas 'Sortie' Termansen
057bd25898 Fix newlines in errx(3) calls. 2016-10-03 16:00:00 +02:00
Daniel Roskams
28fec736dc Document passwd(1). 2016-10-03 21:45:58 +08:00
Jonas 'Sortie' Termansen
07b89e600d Fix kernelinfo(1) reallocation loop never terminating. 2016-10-02 13:50:26 +02:00
Daniel Roskams
e400e3578e Document kernelinfo(1). 2016-10-02 13:26:04 +02:00
Jonas 'Sortie' Termansen
48c60fd3a2 Fix readlink(1) self-reference. 2016-10-01 21:29:30 +02:00
Ralph Holmes
5d774cce1d Fix execl(3) sentinel undefined behaviour.
execl(3) and its variants use a sentinel to terminate the variadic
argument list, in the form of a null pointer constant of type pointer to
char. POSIX mandates that NULL is a null pointer constant of type
pointer to void, which is not of an equivalent type to that required by
execl(3) and its variants, resulting in undefined behaviour.

This commit casts all such instances of NULL to pointer to char type.
For consistency, it also adds const-qualification to any such instances
which had already been casted, and were not const-qualified.
2016-09-30 23:36:49 +02:00