Description:
Q&A for people programming under Unix.
|
|
|
Increment a number in compile time macro
|
| |
switch(i) { case 1: break; case 2: break; [...] case N: break; ...Now, after some time I want to add a 'case 2' between case 1 and case 2, the result means every case number after case 2 need to be incremented by 1, it there a macro tricks to make life easier? Such as: switch(i) { case AUTO_INC_MACRO:... more »
|
|
I need ideas on how to resume a stopped program...
|
| |
Let's say that I have a program that downloads an unknown number of 2MB files from a remote server. Now after say the 500th file tranasfer, I want to stop the program via ctrl -c. Then say 6 hours later, I want to pick up where I left off. Ie, I want to start to download the 501st file. I clearly need to somehow save the state. What would be some sane... more »
|
|
timout file lock request
|
| |
Hi I would like to make a blocking request for a lock on a file, but have the request abort if unsuccessful after some specified timeout. What are the possible methods and what are the advantages/disadvantages? The only thing I can think of is to use alarm() or similar to interrupt a system call.... more »
|
|
Wanted SVR4.2 i486 complete system
|
| |
Sorry, perhaps a bit off topic, but I did not know where else to post. I'm looking for a complete distribution of AT&T System V Release 4.2 UNIX for the i486. I would really like it on 150MB QIC tape, but will take whatever I can get as long as it is a complete system. That means I need the development set, TCP/IP, man pages, SCSI drivers, and at... more »
|
|
POSIX's send() on non blocking sockets may partially write?
|
| |
Hello I am trying to determine by reading the POSIX specification if a conforming send() implementation on a non blocking socket is allowed to return on partial writes. From what I understand if the socket is non blocking and if there isn't enough space in the buffer for the data to send then send will fail with EAGAIN. If however there is... more »
|
|
Various sigaction handler questions
|
| |
1) When processing a SEGV signal from a handler set up via sigaction(SIGSEGV,..), what has to be done to allow a core dump to occur if that is what would have happened without the handler? Exiting from the handler via exit() seems to abort the dump from being taken. 2) Is there a way to intercept asserts()?... more »
|
|
How do I get the status returned by pclose()
|
| |
The following doesn't appear to work. ...static void sig_pipe(int signo) { printf("SIGPIPE caught\n"); exit(1); ...int main(void) { FILE *ptr; int status; char buf[BUFSIZ]; signal(SIGPIPE, sig_pipe); if ((ptr = popen("/home/cdalten/oakland/a m", "r")) == NULL) { fprintf(stderr, "popen error\n");... more »
|
|
|