examples

Toy examples in single C files.
git clone git://henryandlizzy.uk/examples
Log | Files | Refs

whichtty.c (249B)


      1 #include <stdlib.h>
      2 #include <stdio.h>
      3 
      4 #include <unistd.h>
      5 
      6 int main()
      7 {
      8 	char const* ttyname_s = ttyname(STDIN_FILENO);
      9 	char const* ctermid_s = ctermid(NULL);
     10 
     11 	printf("ttyname: %s\nctermid: %s\n", ttyname_s, ctermid_s);
     12 
     13 	return EXIT_SUCCESS;
     14 }