Commit Graph

383 Commits

Author SHA1 Message Date
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
rocketpenguin1 6907109b7e Add -l option to chkblayout(1). 2016-09-30 17:03:29 +02:00
Nicholas De Nova a911476f59 Add readlink(1). 2016-09-29 20:10:58 -05:00
Jonas 'Sortie' Termansen 1a87b2f580 Add suggestion to use vim(1) if installed. 2016-09-29 00:01:41 +02:00
Nicholas De Nova 6e16a2036e Add tee(1). 2016-09-25 20:07:27 -05:00
Jonas 'Sortie' Termansen 264805a4aa Remove uname -i and -o options.
These are unportable GNU extensions that's not needed for Sortix.
2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen e4a3bb997b Check overflow in expr(1). 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 63146072a4 Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
Jonas 'Sortie' Termansen bc2f6842d1 Add -type option to find(1). 2016-03-27 14:51:44 +02:00
Jonas 'Sortie' Termansen fe87b61a33 Add tagline. 2016-03-26 23:50:50 +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 d472818380 Fix pager(1) bugs. 2016-02-24 23:55:34 +01:00
Alexandros Alexandrou 77129524eb Add touch(1). 2016-02-24 17:32:05 +01:00
Jonas 'Sortie' Termansen 70687ac610 Add passwd(1). 2016-02-06 17:12:30 +01:00
Jonas 'Sortie' Termansen 9a1786f688 Add login(8). 2016-02-06 00:52:52 +01:00
Jonas 'Sortie' Termansen b37a679c72 Add -f to cp(1). 2016-02-01 01:45:12 +01:00
Jonas 'Sortie' Termansen bd14553a0f Add df(1). 2016-01-27 21:36:04 +01:00
Jonas 'Sortie' Termansen d1777d7afd Add extfs and unmount suggestions to command-not-found(1). 2016-01-26 22:11:12 +01:00
Jonas 'Sortie' Termansen 0c7d1fe2c1 Add -m support to mkdir(1). 2016-01-26 21:55:40 +01:00
Jonas 'Sortie' Termansen 794cfd057a Add keyboard number selection to chvideomode(1). 2016-01-26 21:17:09 +01:00
Jonas 'Sortie' Termansen 5ba7ce6802 Add backwards support to pager(1). 2016-01-26 21:17:09 +01:00
Jonas 'Sortie' Termansen 2e4b15daed Simplify directory reading. 2016-01-26 18:42:54 +01:00
Jonas 'Sortie' Termansen 328f4e1fd6 Add features to ls(1) and fix implementation issues.
New options:

  -1   Disable columnizing.

  -c   Sort by file status change time.

  -C   Column directory entries.

  -h   Show file sizes with magnitude suffixes such as 42.3K.

  -r   Sort entries in the opposite order.

  -R   Recursively list directory contents.

  -S   Sort by file size in decreasing order.

  -u   Sort by access time.

  --color=always|auto|never
       Control whether colorizing is enabled.

The output is now natively columnized instead of running a column(1)
subprocess. Multiple operands are now implemented correctly (directory
contents are columned separately rather than their concatenation, the name
of each directory is printed prior to its content, ...). The file owner and
group names are now shown rather than a hard-coded root. Long listings are
now properly aligned. Mixing file and directory operands works correctly
now. Columnizing is now vertical rather than across. Clean up the source
code and remove cruft. Stat information on directory entries are read once
only now, which which fixes an incosistent sort race condition when sorting
according to lstat. Move to the openat paradigm.
2016-01-26 17:45:06 +01:00
Jonas 'Sortie' Termansen 4839a97d91 Add colormake support for cc and c++. 2016-01-25 17:42:26 +01:00
Jonas 'Sortie' Termansen ba5af691f9 Add find(1) symbolic link support. 2016-01-25 17:42:25 +01:00
Jonas 'Sortie' Termansen 4333b2e695 Add ln(1) target directory support. 2016-01-25 17:42:25 +01:00
Jonas 'Sortie' Termansen f3e3c98084 Fix ls realloc loop. 2016-01-08 00:47:14 +01:00
Jonas 'Sortie' Termansen 8b52c0d818 Fix wrong type in calloc sizeof. 2016-01-08 00:46:44 +01:00
Jonas 'Sortie' Termansen fad73ab3e1 Fix broken unknown short option reporting. 2016-01-07 19:17:04 +01:00
Jonas 'Sortie' Termansen 1e7bbace90 Fix uninitialized variable in chvideomode option parsing. 2015-12-23 17:22:41 +01:00
Jonas 'Sortie' Termansen 8274981a81 Add chkblayout(1). 2015-12-19 02:49:37 +01:00
Jonas 'Sortie' Termansen 75808c637d Add regex(3). 2015-12-17 23:32:43 +01:00
Jonas 'Sortie' Termansen fd5a850e48 Use signal handlers in time(1) instead of process groups. 2015-12-12 19:28:08 +01:00
Jonas 'Sortie' Termansen 7d10c4caaa Add pager(1) -rR options. 2015-12-12 19:28:08 +01:00
Jonas 'Sortie' Termansen 9d6bd9b830 Add stat(1). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 6dce46c081 Add pstree(1). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 416c87aed9 Add ps(1). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 67af95c7ee Update command line parsing to current coding conventions. 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 4e918687ce Add kill(1). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen cf5c2706b3 Fix unintended extra fork in chroot(1). 2015-12-12 16:53:42 +01:00
Jonas 'Sortie' Termansen 15fd58b6a0 Fix tr buffer overrun and shadowed delete array. 2015-12-12 16:53:42 +01:00
Jonas 'Sortie' Termansen 54b80263a2 Add -d option to chroot(1). 2015-10-28 20:13:37 +01:00
Jonas 'Sortie' Termansen 6138e94124 Fix colormake not resetting color. 2015-10-06 00:36:17 +02:00
Jonas 'Sortie' Termansen a5d050fc49 Add realpath(1). 2015-10-01 22:50:51 +02:00
Jonas 'Sortie' Termansen 8f8ead93f1 Add id(1). 2015-08-26 21:35:11 +02:00
Jonas 'Sortie' Termansen 00f3e97cf7 Replace userland perror calls. 2015-08-26 18:10:24 +02:00
Jonas 'Sortie' Termansen b180a14412 Add mktemp(1). 2015-08-26 17:49:28 +02:00
Jonas 'Sortie' Termansen d7b1dce054 Dumb down echo(1).
Options and escape sequences are fatally incompatible with historic echo
that has no room for such extensions. Instead they pose risk because it is
harder to use echo on unvalidated input safely and because any further
extensions potentially break existing scripts. Use printf(1) instead.
2015-08-22 00:44:39 +02:00
Jonas 'Sortie' Termansen ef45218660 Add S_ISGID and S_ISUID.
I originally left them out because Sortix doesn't have setuid and setgid
executable support, but this created considerable compatibility issues and
it is better to supply them as the mode bits still exist and can be set.
2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen 840c8e6b02 Fix pager double prompt if paging during special character. 2015-08-14 17:26:07 +02:00
Jonas 'Sortie' Termansen ec38222f9b Fix head(1) and tail(1) directory handling. 2015-08-11 15:57:55 +02:00
Jonas 'Sortie' Termansen c81610f7a3 Fix du counting block devices. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 40594eba1c Fix sort(1) reverse sort not working. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 1d7c157848 Fix ls closing stdout twice. 2015-05-15 16:18:41 +02:00
Jonas 'Sortie' Termansen f3e4be0d83 Fix getdelim(3). 2015-05-15 16:18:40 +02:00
Jonas 'Sortie' Termansen f384fcdff1 Run time(1) children in their own process group. 2015-02-08 22:58:32 +01:00
Jonas 'Sortie' Termansen e76d4a90c5 Silence maybe initialized warning in pager. 2015-02-06 14:55:35 +01:00
Jonas 'Sortie' Termansen ab66b91086 Fix NOTO typo. 2014-12-28 20:18:58 +01:00
Jonas 'Sortie' Termansen a4ee2e3724 Add space as an alias for page down in pager(1). 2014-12-28 20:18:58 +01:00
Jonas 'Sortie' Termansen 9c2f89d56c Work around a getdelim bug in column(1). 2014-12-28 20:18:58 +01:00
Jonas 'Sortie' Termansen d238518c35 Rewrite pager(1). 2014-12-27 23:43:39 +01:00
Jonas 'Sortie' Termansen 77cf804ed2 Move init to its own directory. 2014-12-26 21:48:15 +01:00
Jonas 'Sortie' Termansen 2abd0cf754 Add unmount(1). 2014-12-26 21:45:29 +01:00
Jonas 'Sortie' Termansen e88a3ef654 Fix cp(1) error message. 2014-12-26 14:18:25 +01:00
Jonas 'Sortie' Termansen 08461c72fa Move editor to its own subdirectory. 2014-12-07 20:29:08 +01:00
Jonas 'Sortie' Termansen d8df769692 Move sh to its own directory. 2014-12-07 18:25:09 +01:00