Correzioni per consentire la compilazione e l'uso del Makefile con un
authorSimone Piccardi <piccardi@truelite.it>
Tue, 6 Aug 2019 15:36:32 +0000 (17:36 +0200)
committerSimone Piccardi <piccardi@truelite.it>
Tue, 6 Aug 2019 15:36:32 +0000 (17:36 +0200)
gcc piĆ¹recente (e versioni recenti delle librerie con diverse
posizioni dei file di include).

sources/Flock.c
sources/FortuneClient.c
sources/Gapil.h
sources/Makefile
sources/getparam.c

index 82790ec551835be75ac598a59fdf573e859f3216..90e76614f23b92f2c109d136ea10b837b253d83e 100644 (file)
@@ -36,7 +36,7 @@
 #include <stdio.h>      /* standard I/O library */
 #include <string.h>      /* C strings library */
 #include <fcntl.h>       /* file control functions */
 #include <stdio.h>      /* standard I/O library */
 #include <string.h>      /* C strings library */
 #include <fcntl.h>       /* file control functions */
-
+#include <sys/file.h>
 
 /* user defined header */
 #include "macros.h"      /* some useful macros */
 
 /* user defined header */
 #include "macros.h"      /* some useful macros */
index 5d8ba0af50d8c340e9d311cdb9cdaac58273d373..99af385be0e9ae9eb5ef1880b7c6e033d096be17 100644 (file)
@@ -38,6 +38,7 @@
 #include <fcntl.h>       /* file control functions */
 #include <string.h>     /* C strings library */
 #include <limits.h>      /* system limits constants, types and functions */
 #include <fcntl.h>       /* file control functions */
 #include <string.h>     /* C strings library */
 #include <limits.h>      /* system limits constants, types and functions */
+#include <sys/stat.h>
 
 #include "macros.h"
 
 
 #include "macros.h"
 
index dc421f44e1c91f2333305d7712c4fc8e004dcff9..70c796df0be46cd6e1ac99792bb0bd81e03dc5d9 100644 (file)
@@ -56,36 +56,36 @@ union semun {
  * Mutex handling Functions
  */
 /* Function MutexCreate: create a mutex. See Mutex.c */
  * Mutex handling Functions
  */
 /* Function MutexCreate: create a mutex. See Mutex.c */
-inline int MutexCreate(key_t ipc_key);
+int MutexCreate(key_t ipc_key);
 /* Function MutexFind: get the mutex ID given fomr IPC key. See Mutex.c */
 /* Function MutexFind: get the mutex ID given fomr IPC key. See Mutex.c */
-inline int MutexFind(key_t ipc_key);
+int MutexFind(key_t ipc_key);
 /* Function MutexRead: read the current value of the mutex. See Mutex.c */
 /* Function MutexRead: read the current value of the mutex. See Mutex.c */
-inline int MutexRead(int sem_id);
+int MutexRead(int sem_id);
 /* Function MutexLock: to lock a mutex/semaphore. See Mutex.c */
 /* Function MutexLock: to lock a mutex/semaphore. See Mutex.c */
-inline int MutexLock(int sem_id);
+int MutexLock(int sem_id);
 /* Function MutexUnlock: to unlock a mutex/semaphore. See Mutex.c */
 /* Function MutexUnlock: to unlock a mutex/semaphore. See Mutex.c */
-inline int MutexUnlock(int sem_id);
+int MutexUnlock(int sem_id);
 /* Function MutexRemove: remove the mutex/semphore. See Mutex.c */
 /* Function MutexRemove: remove the mutex/semphore. See Mutex.c */
-inline int MutexRemove(int sem_id);
+int MutexRemove(int sem_id);
 /* Function CreateMutex: create a mutex (using file locking). See Mutex.c */
 /* Function CreateMutex: create a mutex (using file locking). See Mutex.c */
-inline int CreateMutex(const char *path_name);
+int CreateMutex(const char *path_name);
 /* Function UnlockMutex: find a mutex (using file locking). See Mutex.c */
 /* Function UnlockMutex: find a mutex (using file locking). See Mutex.c */
-inline int FindMutex(const char *path_name);
+int FindMutex(const char *path_name);
 /* Function LockMutex: acquire a mutex (using file locking). See Mutex.c */
 /* Function LockMutex: acquire a mutex (using file locking). See Mutex.c */
-inline int LockMutex(int fd);
+int LockMutex(int fd);
 /* Function UnlockMutex: release a mutex (using file locking). See Mutex.c */
 /* Function UnlockMutex: release a mutex (using file locking). See Mutex.c */
-inline int UnlockMutex(int fd);
+int UnlockMutex(int fd);
 /* Function ReadMutex: read a mutex (using file locking). See Mutex.c */
 /* Function ReadMutex: read a mutex (using file locking). See Mutex.c */
-inline int ReadMutex(int fd);
+int ReadMutex(int fd);
 /* Function RemoveMutex: remove a mutex (using file locking). See Mutex.c */
 /* Function RemoveMutex: remove a mutex (using file locking). See Mutex.c */
-inline int RemoveMutex(const char *path_name);
+int RemoveMutex(const char *path_name);
 /* 
  * Lock files function: to create and destroy lock files
  */
 /* Function LockFile: create a lock file. See FileLock.c */
 /* 
  * Lock files function: to create and destroy lock files
  */
 /* Function LockFile: create a lock file. See FileLock.c */
-inline int LockFile(const char* path_name);
+int LockFile(const char* path_name);
 /* Function UnlockFile: remove a lock file. See FileLock.c */
 /* Function UnlockFile: remove a lock file. See FileLock.c */
-inline int UnlockFile(const char* path_name);
+int UnlockFile(const char* path_name);
 /*
  * Signal Handling Functions
  */
 /*
  * Signal Handling Functions
  */
index 97f4dfe09370ac186aaaaca08fd572e4bc293b4d..ea5155b50d0e65358f941b5a7eec005f51332627 100644 (file)
@@ -23,13 +23,13 @@ $(OBJ): Gapil.h
 all: $(FINAL) $(LIB)
 
 dirmonitor: DirMonitor.c
 all: $(FINAL) $(LIB)
 
 dirmonitor: DirMonitor.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 readmon: ReadMonitor.c
 
 readmon: ReadMonitor.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 myls: myls.c  
 
 myls: myls.c  
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 mylschroot: mylschroot.c  
        $(CC) --static  $^ dir_scan.o -o $@
 
 mylschroot: mylschroot.c  
        $(CC) --static  $^ dir_scan.o -o $@
@@ -38,22 +38,22 @@ flock: Flock.c
        $(CC) $^ -o $@ 
 
 mqfortune: MQFortuneClient.c FortuneParse.c
        $(CC) $^ -o $@ 
 
 mqfortune: MQFortuneClient.c FortuneParse.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ)
 
 mqfortuned: MQFortuneServer.c FortuneParse.c 
 
 mqfortuned: MQFortuneServer.c FortuneParse.c 
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 fortune: FortuneClient.c
 
 fortune: FortuneClient.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 fortuned: FortuneServer.c FortuneParse.c 
 
 fortuned: FortuneServer.c FortuneParse.c 
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 message_setter: message_setter.c
 
 message_setter: message_setter.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 message_getter: message_getter.c
 
 message_getter: message_getter.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt -lpthread
 
 barcode: BarCode.c
        $(CC)  $^ -o $@
 
 barcode: BarCode.c
        $(CC)  $^ -o $@
@@ -62,60 +62,60 @@ barcodepage: BarCodePage.c
        $(CC) $^ -o $@
 
 getparam: getparam.c
        $(CC) $^ -o $@
 
 getparam: getparam.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 testfopen: test_fopen.c
 
 testfopen: test_fopen.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 testren: TestRen.c
 
 testren: TestRen.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 forktest: fork_test.c 
 
 forktest: fork_test.c 
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt
 
 errcode: ErrCode.c 
 
 errcode: ErrCode.c 
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 uecho: UDP_echo.c
 
 uecho: UDP_echo.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ)
 
 techo: TCP_echo.c
 
 techo: TCP_echo.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
 
 echod: TCP_echod.c
 
 echod: TCP_echod.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
 
 sechod: select_echod.c
 
 sechod: select_echod.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
 
 pechod: poll_echod.c
 
 pechod: poll_echod.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
 
 daytimed: UDP_daytimed.c # TCP_cunc_daytimed.c
 
 daytimed: UDP_daytimed.c # TCP_cunc_daytimed.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 iterdaytimed: TCP_iter_daytimed.c
 
 iterdaytimed: TCP_iter_daytimed.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 daytime: UDP_daytime.c # TCP_daytime.c 
 
 daytime: UDP_daytime.c # TCP_daytime.c 
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@
 
 ipctestid: IPCTestId.c
 
 ipctestid: IPCTestId.c
-       $(CC)  $^ -o $@
+       $(CC) $^ -o $@
 
 writeshm: WriteShm.c
 
 writeshm: WriteShm.c
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@ $(CFLAGJ) -lrt 
 
 mygetaddr: mygetaddr.c  
 
 mygetaddr: mygetaddr.c  
-       $(CC) $(CFLAGJ) $^ -o $@
+       $(CC) $^ -o $@
 
 endtest: endtest.c
 
 
 endtest: endtest.c
 
-readshm: ReadShm.c
-       $(CC) $(CFLAGJ) $^ -o $@
+#readshm: ReadShm.c
+#      $(CC) $^ -o $@
 
 wwwd: wwwd.c
 
 wwwd: wwwd.c
-       $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+       $(CC) $(CFLAGS) $^ -o $@  $(CFLAGJ) -lrt
 
 acctctrl: AcctCtrl.c
        $(CC) $(CFLAGS) $^ -o $@
 
 acctctrl: AcctCtrl.c
        $(CC) $(CFLAGS) $^ -o $@
index f44f51d9016775ecb557a940bf00e330fcd8da5d..b5207b7188e185267acf8e79500bd942a6932cb1 100644 (file)
@@ -172,8 +172,8 @@ int main(int argc, char *argv[])
        usage();
     }
     for (i=0; i<=4; i++) {
        usage();
     }
     for (i=0; i<=4; i++) {
-       printf("Response for %s is %ld, values is %ld\n", names[i], 
-              sysconf(argument[i]), values[i]);
+       printf("Response for %s is %ld, values is %ld\n",sc_names[i], 
+              sysconf(sc_argument[i]), values[i]);
     }
     return 0;
 }
     }
     return 0;
 }