Jan
29
awarded  Necromancer
2018
Nov
11
awarded  Student
Oct
28
comment What is the min and max values of exit codes in Linux?
@schily: If that is true (I don't think it is, but anyway), then Linux is broken. Please read the linked-to-in-answer POSIX specification of exit, in particular the second line under "Description" which states: "though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process". That is how a conforming implementation works -- lowermost 8 bits, not 32. Do you have a reference for 32 bits being passed on?
Oct
27
comment What is the min and max values of exit codes in Linux?
@schily: Not sure what you mean? waitid() does just the same thing, slightly differently. It waits for a particular id or any thread, and it writes results to the pointed-to siginfo_t structure where si_status is int (so... signed, just the same). Still, exit() only passes the lowermost 8 bits, so... absolutely the same thing under the hood.
Aug
28
awarded  Yearling
Aug
12
revised Do I need swap space if I have more than enough amount of RAM?
added 52 characters in body
Aug
12
comment Do I need swap space if I have more than enough amount of RAM?
@slm man7.org/linux/man-pages/man2/mmap.2.html, description of the MAP_NORESERVE flag (which does not reserve, same thing as happens for every mmap when you have no swap).
Aug
9
revised Do I need swap space if I have more than enough amount of RAM?
added 127 characters in body
Jul
10
comment Why is mv so much faster than cp? How do I recover from an incorrect mv command?
In addition to making a copy of the data, copying files also has to read and access-check every inode (recursively) within the directory, and has to create inodes at the destination. Depending on implementation details, this can be much slower than actually copying the bulk of data. Moving ideally (when on the same volume) only changes one link.
Jun
22
comment How do pipelines limit memory usage?
I have never seen such a limit, and I do not think that in theory there ever was one. In practice, anything that has a filename needs an inode, and the number of inodes is, of course, finite. As are the number of physical pages on a system, if nothing else. Modern systems guarantee 4k atomic writes, so each pipe must at least own one complete 4k page, which puts a hard limit on the number of pipes you can have. But consider having a couple of gigabytes of RAM... practically, that's a limit you will never encounter. Try and type a few million pipes on a terminal... :)
Jun
22
answered How do pipelines limit memory usage?
Mar
6
comment Download big file over bad connection
300MB in one hour is 85 kB per second. If you get 80-120 kB/s in the average case, this should be OK without running 10 downloads in parallel? I do wonder whether that throttling is really intentional, though. If it varies so much (40-300 kB/s) it's most likely rather the network being congested on their end, so more connections make no difference anyway.
Jan
23
answered What is the min and max values of exit codes in Linux?
2017
Oct
19
answered When to call fork() and exec() by themselves?
Aug
28
awarded  Yearling
Mar
8
revised Do I need swap space if I have more than enough amount of RAM?
added 1756 characters in body
2016
Aug
28
awarded  Yearling
Apr
15
comment What is the safest way for programmatically writing to a file with root privileges?
Why don't you just start your program with root privileges, open the file, and drop privileges? That's how every webserver or such does it for sockets. Effectively, you are not running as root, nor is a helper necessary that does.
2015
Aug
28
awarded  Yearling
Apr
1
answered What is a socket?