dichiarazioni delle funzioni di sistema.
#include <dirent.h> /* directory operation constants and functions */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
+#include <string.h> /* C strings library */
#include "Gapil.h"
#include "macros.h"
#include <dirent.h> /* directory operation constants and functions */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
+#include <string.h> /* C strings library */
#include "Gapil.h"
#include "macros.h"
#include <unistd.h> /* unix standard library */
#include <termios.h> /* terminals constants, types and functions */
#include <errno.h> /* error definitions and routines */
+#include <stdio.h> /* standard I/O library */
int SetTermAttr(int fd, tcflag_t flag)
{
struct termios values;
int res;
- res = tcgetattr (desc, &values);
+ res = tcgetattr (fd, &values);
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag |= flag;
- res = tcsetattr (desc, TCSANOW, &values);
+ res = tcsetattr (fd, TCSANOW, &values);
if (res) {
perror("Cannot set attributes");
return res;
struct termios values;
int res;
- res = tcgetattr (desc, &values);
+ res = tcgetattr (fd, &values);
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag &= (~flag);
- res = tcsetattr (desc, TCSANOW, &values);
+ res = tcsetattr (fd, TCSANOW, &values);
if (res) {
perror("Cannot set attributes");
return res;
#include <sys/socket.h> /* socket constants, types and functions */
#include <stdio.h> /* standard I/O library */
#include <time.h> /* date and time constants, types and functions */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#define MAXLINE 80
#define BACKLOG 10
#include <arpa/inet.h> /* IP addresses conversion utilities */
#include <sys/socket.h> /* socket constants, types and functions */
#include <stdio.h> /* standard I/O library */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#define MAXLINE 80
/* Program begin */
#include <sys/socket.h> /* socket constants, types and functions */
#include <stdio.h> /* standard I/O library */
#include <time.h> /* date and time constants, types and functions */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#define MAXLINE 80
#define BACKLOG 10
#include <arpa/inet.h> /* IP addresses conversion utilities */
#include <sys/socket.h> /* socket constants, types and functions */
#include <stdio.h> /* standard I/O library */
-#include <stdlib.h> /* standard library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
#define MAXLINE 80
/* Program begin */
#include <sys/socket.h> /* socket constants, types and functions */
#include <stdio.h> /* standard I/O library */
#include <time.h> /* date and time constants, types and functions */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#define MAXLINE 80
/* Program begin */
#include <stdio.h> /* standard I/O library */
#include <errno.h> /* error definitions and routines */
#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "macros.h"
#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utilities */
#include <netdb.h> /* C resolver library */
-
-
+#include <netinet/tcp.h> /* TCP socket option */
extern int h_errno;