#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 */
#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"
* 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 */
-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 */
-inline int MutexRead(int sem_id);
+int MutexRead(int sem_id);
/* 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 */
-inline int MutexUnlock(int sem_id);
+int MutexUnlock(int sem_id);
/* 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 */
-inline int CreateMutex(const char *path_name);
+int CreateMutex(const char *path_name);
/* 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 */
-inline int LockMutex(int fd);
+int LockMutex(int fd);
/* 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 */
-inline int ReadMutex(int fd);
+int ReadMutex(int fd);
/* 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 */
-inline int LockFile(const char* path_name);
+int LockFile(const char* path_name);
/* 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
*/
all: $(FINAL) $(LIB)
dirmonitor: DirMonitor.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
readmon: ReadMonitor.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
myls: myls.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
mylschroot: mylschroot.c
$(CC) --static $^ dir_scan.o -o $@
$(CC) $^ -o $@
mqfortune: MQFortuneClient.c FortuneParse.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ)
mqfortuned: MQFortuneServer.c FortuneParse.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
fortune: FortuneClient.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
fortuned: FortuneServer.c FortuneParse.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
message_setter: message_setter.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
message_getter: message_getter.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt -lpthread
barcode: BarCode.c
$(CC) $^ -o $@
$(CC) $^ -o $@
getparam: getparam.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
testfopen: test_fopen.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
testren: TestRen.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
forktest: fork_test.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
errcode: ErrCode.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
uecho: UDP_echo.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ)
techo: TCP_echo.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
echod: TCP_echod.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
sechod: select_echod.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
pechod: poll_echod.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
daytimed: UDP_daytimed.c # TCP_cunc_daytimed.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
iterdaytimed: TCP_iter_daytimed.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
daytime: UDP_daytime.c # TCP_daytime.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@
ipctestid: IPCTestId.c
- $(CC) $^ -o $@
+ $(CC) $^ -o $@
writeshm: WriteShm.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@ $(CFLAGJ) -lrt
mygetaddr: mygetaddr.c
- $(CC) $(CFLAGJ) $^ -o $@
+ $(CC) $^ -o $@
endtest: endtest.c
-readshm: ReadShm.c
- $(CC) $(CFLAGJ) $^ -o $@
+#readshm: ReadShm.c
+# $(CC) $^ -o $@
wwwd: wwwd.c
- $(CC) $(CFLAGJ) $(CFLAGS) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ $(CFLAGJ) -lrt
acctctrl: AcctCtrl.c
$(CC) $(CFLAGS) $^ -o $@
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;
}