Portable non GNU TEMP_FAILURE_ENTRY macro

In addition to that subject Here is a portable macro that can be used in place of TEMP_FAILURE_ENTRY, without GNU_SOURCE (took from stackoverflow):

#define CALL_RETRY(retvar, expression) do { \
    retvar = (expression); \
} while (retvar == -1 && errno == EINTR);
/* call example */
char buf[ 4096 ] = "" ;
int retval = -1 ;
/* ... stripped socket initialisation code ... */
CALL_RETRY( br , recv( s , buf , 1024, 0 ) );

In case you receive a “interrupted system calls” signal, there is a chance that this trick may help / guide you to the answer.

#gdb #socket #linux #redhat #EINTR #recv #send

execve: no such file or directory

If one day when using execve you encounter the “no such file or directory” problem, and that the file you tried to launch is really existing and with the good rights, then the problem is coming from the shebang not pointing to a valid interpreter.

In example: #!/bin/ksh and ksh is not installed

#reminder #execve

New to GDB or in need of good ressources about it ?

Here you go:

That manual I stumbled upon while searching for some informations on how to configure gdb is THE thing.

From starting to crashing, each possible good analysis is covered in that manual.

Good reading !

#debugger #code #gdb