Tag Info

New answers tagged

2

Time-sliced threads are threads executed by a single CPU core without truly executing them at the same time (by switching between threads over and over again). This is the opposite of simultaneous multithreading, when multiple CPU cores execute many threads. Interrupts interrupt thread execution no matter of technology, and when interrupt handling code ...


4

POSIX command/process substitution _log()( x=0 while [ -e "${TMPDIR:=/tmp}/$$.$((x+=1))" ] do continue; done && mkfifo -- "$TMPDIR/$$.$x" && printf %s\\n "$TMPDIR/$$.$x" || exit exec >&- >/dev/null { rm -- "$TMPDIR/$$.$x" logger --priority user."$1" --tag "${0##*/}" } ...


6

There's no POSIX equivalent. You can only perform a redirection with exec, not a fork. A pipe requires a fork, and the shell waits for the child to finish. One solution is to put all your code in a function. all_my_code () { … } { all_my_code | logger --priority user.notice --tag "$(basename "$0")"; } 2>&1 | logger --priority user.error --tag ...


3

grep -F is POSIX. fgrep is not. Use grep -F and make it clear that your script depends on a POSIX grep. Clearly stated dependencies are all you need. I guess you could use both... if command -v fgrep then _grepf(){ fgrep "$@"; } else _grepf(){ grep -F "$@"; } fi >/dev/null ...but doing stuff like that is hacky and usually a waste of time. Set ...


0

make is successful when #endif is moved from line 526 of Modules/posixmodule.c to line 513.


7

Dennis Ritchie set himself a constraint with C that it wouldn't rely on any linker features that weren't also required by Fortran. Hence the 6 character limit on external names.


3

I don't believe there are any commands that allow you to monitor POSIX message queues specifically. As you mentioned, all of the details are exposed via a pseudo filesystem, usually mounted under /dev/mqueue. Once you've done that, you can then use file management commands like ls, rm, cat, etc. to inspect and manage the queue details.


17

In addition to the other answers, I would like to point out that Unix was developed as a reaction to Multics, CTSS, and other contemporary operating systems, which were significantly more verbose about their naming conventions. You can get a feel for these OSes at http://www.multicians.org/devdoc.html. For example, ...


21

dr01 is right, but there's also another reason - usability. Back in the day, you didn't have something as comfortable as a keyboard to type on. If you were lucky, you had something akin to an old-school typewriter. If you were unlucky, you had to deal with systems that required actual physical work to operate (as in, it took a lot of force to press the ...


49

It's due to the technical constraints of the time. The POSIX standard was created in the 1980s and referred to UNIX, which was born in the 1970. Several C compilers at that time were limited to identifiers that were 6 or 8 characters long, so that settled the standard for the length of variable and function names.


0

It seems the script expects several parameters which are set by OpenVPN in the environment variables like time_unix and time_duration, but they are missing. You shouldn't directly run it. Have you set up the script correctly as explained in the document? See also OpenVPN manpage. You might want to add printenv to debug the script. All available ...


1

There is no. Very easy to write one with perl. Here's untrap script: #!/usr/bin/perl $SIG{INT} = "DEFAULT"; exec { $ARGV[0] } @ARGV or die "couldn't exec $ARGV[0]: $!"; Example usage: #!/bin/bash untrap bash -c ' sleep 3 echo aaa ' & trap '' INT wait $! If you remove untrap prefix, Ctrl-C won't kill the script. More versatile script: ...



Top 50 recent answers are included