Skip to content

Instantly share code, notes, and snippets.

@scriptnull
Last active August 19, 2018 16:39
Show Gist options
  • Select an option

  • Save scriptnull/a801aee3d7a651e8009c7171df9c5145 to your computer and use it in GitHub Desktop.

Select an option

Save scriptnull/a801aee3d7a651e8009c7171df9c5145 to your computer and use it in GitHub Desktop.
Demonstrates error in finding the system configuration of terminal as mentioned in http://man7.org/tlpi/
#include<unistd.h>
#include<stdio.h>
int main() {
long max_input, max_canon;
max_input = sysconf(_SC_MAX_INPUT);
max_canon = sysconf(_SC_MAX_CANON);
printf("max_input: %ld \n", max_input);
printf("max_canon: %ld \n", max_canon);
return 0;
}
$ gcc term_limits.c -o term_limit.out
term_limits.c:7:23: error: use of undeclared identifier '_SC_MAX_INPUT'
max_input = sysconf(_SC_MAX_INPUT);
^
term_limits.c:8:23: error: use of undeclared identifier '_SC_MAX_CANON'
max_canon = sysconf(_SC_MAX_CANON);
^
2 errors generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment