Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<stdio.h>
- #include<string.h>
- #include<errno.h>
- #include<unistd.h>
- void mysyserr(char *mymsg)
- {
- int dlugosc = strlen(strerror(errno));
- char msg[100] = "ERROR: ";
- strcat(msg, mymsg);
- write(2,msg,strlen(msg));
- write(2,strerror(errno),dlugosc);
- /*
- printf("(erron: %d, %s)\n", errno, strerror(errno));
- */
- exit(errno);
- }
- int main()
- {
- char buf[128];
- int ile;
- if((ile = read(77, buf, 128)) == -1)
- mysyserr("blad funkcji read ");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement