Cómo usar errno en C

· c

Escuchar este artículo

Descargar MP3 · Ver en Internet Archive

#include <errno.h>
#include <string.h>

/* ... */

if(read(fd, buf, 1)==-1) {
    printf("Oh dear, something went wrong with read()! %s\n", strerror(errno));
}