Commit graph

105 commits

Author SHA1 Message Date
Warner Losh e043f37205 bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:23:59 -07:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh 90aea514c6 bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:28 -07:00
Bojan Novković 128f63cedc (s)tty: add support for IUTF8 input flag
This patch adds the necessary kernel and stty code to support setting
the IUTF8 flag for ttys. It is the first of two patches that fix
backspace behaviour for UTF-8 encoded characters when in canonical mode.

Reported by:	christos
Reviewed by:	christos, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D42066
2023-10-07 20:59:57 +03:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Konstantin Belousov a7eac01843 stty(1): provide details about interaction with job control
Describe a shell trick to do non-blocking modification of the terminal
settings, by ignoring job control signals with trap built-in.

PR:	266627
With input from:	jilles
Reviewed by:	pauamma
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36745
2022-10-02 20:29:53 +03:00
Warner Losh f5dcfbe36e stty: Remove stray '-'.
There's a stray '-' that causes Fl to double the dash, but that's not
how the command works.

MFC After:		2 days
Sponsored by:		Netflix
2022-05-24 14:31:28 -06:00
Stefan Eßer 50fcb4ee77 Replace sscanf() by strtoul()
This change has been motivated by a mail from bde sent in 2015 in
which he mentioned inappropriate use of sscanf() in 3 programs in
/bin.

This change removes the potential mismatch of the types of the return
values and the variable width specified in the scan pattern. While
there was no issue with the patterns and types used, the new code is
simpler and more efficient.
2020-12-27 22:32:22 +01:00
Xin LI 3601af4da2 Remove unneeded headers.
MFC after:	2 weeks
2020-12-12 02:24:33 +00:00
Stephen Hurd 705aad98c6 Some devices take undesired actions when RTS and DTR are
asserted. Some development boards for example will reset on DTR,
and some radio interfaces will transmit on RTS.

This patch allows "stty -f /dev/ttyu9.init -rtsdtr" to prevent
RTS and DTR from being asserted on open(), allowing these devices
to be used without problems.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D20031
2019-06-12 18:07:04 +00:00
Conrad Meyer 93806cf9e5 stty.1: Document kern.tty_info_kstacks behavior (r339471)
Reported by:	bdrewery
Reviewed by:	bdrewery
Sponsored by:	Dell EMC Isilon
2018-10-20 18:53:32 +00:00
Edward Tomasz Napierala 7a467312ef .Xr pstat(8), so that people have a chance to learn how to get a list
of terminal devices using "pstat -t".

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-03-02 14:16:19 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Edward Tomasz Napierala 452bdaabb5 .Xr resizewin from stty(1) man page.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-07 11:44:25 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Sevan Janiyan 3578fc3e0c Add history section for stty(1)
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/stty.1

PR:		211788
Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D8104
2016-10-05 19:37:46 +00:00
Glen Barber ac2875fa16 Explicitly add unmarked bin/ binaries to the runtime package.
Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate
package, which requires pre-install/post-install scripts, to be
added later.

Sponsored by:	The FreeBSD Foundation
2016-02-09 16:58:50 +00:00
Baptiste Daroussin 6f7c45c9d5 Prevent potential integer overflow
PR:		192971
Submitted by:	David Carlier <david.carlier@hardenedbsd.org>
2015-07-13 05:59:41 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Jilles Tjoelker 989006abe5 stty: Mark usage() __dead2.
This reduces code size a little and should fix a scan-build warning.
2012-07-15 21:12:22 +00:00
Joel Dahl 748611c9c0 mdoc: fix column names, indentation, column separation within each row, and
quotation. Also make sure we have the same amount of columns in each row as
the number of columns we specify in the head arguments.

Reviewed by:	brueffer
2012-04-07 09:05:30 +00:00
Joel Dahl 904d0726c8 Remove superfluous paragraph macro. 2012-03-25 09:20:14 +00:00
Ed Schouten 7b44b80961 Move 3.5 KB from the data segment to the text segment.
The `struct modes' are only used by the getter-functions in the same
file, so we can safely mark them static and const.
2011-12-11 09:56:48 +00:00
Ruslan Ermilov a35a58824b Don't call -f option's argument "stdin".
MFC after:	3 days
2011-05-03 10:08:11 +00:00
Ed Schouten 736fc28680 Add a new libc function: cfmakesane(3).
I've noticed various terminal emulators that need to obtain a sane
default termios structure use very complex `hacks'. Even though POSIX
doesn't provide any functionality for this, extend our termios API with
cfmakesane(3), which is similar to the commonly supported cfmakeraw(3),
except that it fills the termios structure with sane defaults.

Change all code in our base system to use this function, instead of
depending on <sys/ttydefaults.h> to provide TTYDEF_*.
2010-11-02 17:00:56 +00:00
Ulrich Spörlein 0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Ed Schouten f8f8c9f0d6 Make stty(1) use tab0 and tab3 to handle tab completion.
After the MPSAFE TTY import, we have support for the TAB0 and TAB3 flags
to handle tab expansion, while we only used to support OXTABS. Switch
stty(1) to use tab0 and tab3 to print whether tab expansion is turned on
or off. Implement the oxtabs and tabs switches by setting the
appropriate TABx value.

Even though POSIX only lists this as being XSI, we'd better follow it.
2008-08-23 13:28:55 +00:00
Colin Percival f9bcf9cabf Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".
2008-08-04 01:25:48 +00:00
Ed Schouten 94a340ae73 Remove OTTYDISC, NETLDISC and NTTYDISC definitions.
When I ported most applications away from <sgtty.h>, I noticed none of
them were actually using these definitions. I kept them in place,
because I didn't want to touch tools like pstat(8) and stty(1).

In preparation for the MPSAFE TTY layer, remove these definitions. This
doesn't have any impact with respect to binary compatibility (see
tty_conf.c).

We couldn now add an #error to <sys/ioctl_compat.h> when included
outside the kernel. Unfortunately, kdump's mkioctls includes this file
unconditionally.

Approved by:	philip (mentor)
2008-07-16 11:20:04 +00:00
Andrey A. Chernov aaf9c3b784 Fix: printed output flags (onocr) and (onlret) same as oxtabs
PR:             81256
Submitted by:   Arseny Nasokin <tarc@tarc.po.cs.msu.su>
2005-05-26 06:57:57 +00:00
Ruslan Ermilov a89237ae95 Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
Ruslan Ermilov 6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Warner Losh 9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Andrey A. Chernov b56bffc41b Back out recent TTYDEF_LFLAG_ECHO invention.
This change is NOP, because TTYDEF_LFLAG = TTYDEF_LFLAG_ECHO now,
but to minimize diffs with other BSDs.
2004-11-06 13:56:18 +00:00
Poul-Henning Kamp 9372ddf0d1 stty sane should set the echo bits.
PR:	73423
Submitted by:	Michiel Boland <michiel@boland.org>
Overlooked by:	phk
2004-11-02 18:10:01 +00:00
Ruslan Ermilov 1171aedcdf Deal with double whitespace. 2004-07-03 00:06:28 +00:00
Ruslan Ermilov eccea571a7 Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
Mark Murray 6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Mark Murray 97daf7ec12 Fix format warning. This is WARNS=9, std=c99 clean on i386. 2003-05-03 10:16:51 +00:00