This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: NagaChaitanya Vellanki | |
* | |
* tee - read from standard input and write to standard output and files | |
* | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: Nagachaitanya Vellanki | |
* | |
* yes - output a string repeatedly until killed | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdarg.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: NagaChaitanya Vellanki | |
* | |
* whoami - print effective user id | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdarg.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Author: NagaChaitanya Vellanki | |
* | |
* | |
* printenv command implementation | |
* | |
*/ | |
#include<stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Author: NagaChaitanya Vellanki | |
* | |
* | |
* display environment variables | |
* | |
*/ | |
#include<stdio.h> | |
#include<stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Author: NagaChaitanya Vellanki | |
* | |
* | |
* get or set or unset environment variables | |
* clean environment | |
* gcc -o get_set_env -Wall --pedantic get_set_env.c -D_SVID_SOURCE | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: NagaChaitanya Vellanki | |
* | |
* TRY/THROW/CATCH example | |
* Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html | |
* use gcc -E -P exception_handling_1.c to the output of the preprocessor | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: NagaChaitanya Vellanki | |
* | |
* TRY/THROW/CATCH - example | |
* Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html | |
* | |
* use gcc -E -P exception_handling_2.c to the output of the preprocessor | |
*/ | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: NagaChaitanya Vellanki | |
* | |
* TRY/THROW/CATCH/FINALLY - example | |
* Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html | |
* | |
* use gcc -E -P exception_handling_3.c to see the result of the preprocessing | |
* step | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Author: NagaChaitanya Vellanki | |
* | |
* | |
* See Listing 7-1, chapter 4 of LPI book | |
* | |
* sample output: | |
* | |
* ./free_and_sbrk 1000 10240 1 1 1000 |
OlderNewer