Sie sind auf Seite 1von 1

#include <stdio.h> #include <unistd.

h>
#include <stdlib.h> #include <sys/types.h>
#include <malloc.h> #include <sys/ipc.h>
#include <string.h> #include <sys/msg.h>
#include <errno.h> #include <sys/sem.h>
#include <math.h> #include <sys/shm.h>
#include <ctype.h> #include <signal.h>
strcpy(s1, s2); copia s2 in s1 (sostituisce).
strcat(s1, s2); copia s2 in fondo a s1 (aggiunge).
strcmp(s1, s2); confronta lessicograficam. s1 cn
strlen(s); lunghezza di s.
int execl(const char *path, const char *arg, ...);
Sostit. il proc. con uello nl path! (dopo gli arg" #$%%).
pid_t getpid();
pid_t getppid();
pid_t fork(void);
F!" *fopen(char *nome, char *modo);
stream & fopen('miofile.t(t'" r)!
int fprintf(F!" *stream, char *formato, argomenti ...);
scri)e sul file puntato dallo stream.
int fscanf(F!" *stream, char *formato, argomenti ...);
feof(); >* se se lo stream raggiunge la fine del file.
ffl#sh(F!" *stream);
fclose(F!" *stream);
int msgget(key_t key, int msgflg);
int +id & msgget(,-./" 012+23456 7 *...)!
int msgsnd(int ms$id, void *msgp, si%e_t msgs%,int msgflg);
81 se errore altrimenti se flag 012+#9:506 *! se flag * sospensi)a.
ssi%e_t msgrcv(int ms$id, void *msgp, si%e_t msgs%, long msgtyp, int msgflg);
ritorna il numero di bytes copiati. (;lag come snd)
int msgctl(int ms$id, int cmd, str#ct ms$id_ds *&#f);
msgctl(int msid" 012+3<0=" *)!
int semget(key_t key, int nsems, int semflg);
81 se fallisce" semid) dell>array di (nsems semafori altrimenti.
int semctl(int semid, int semn#m, int cmd, args);
operazioni sui semafori (inizializzazione" disallocazione..)
int semop(int semid, str#ct sem&#f *sops , si%e_t nsops);
sem+op& 1! (signal) sem+op& 81! (?ait) sem+op& *! (attende che sem+)al& *)
S46@5% //0nizializza il semaforo specificato semctl(semid"2"S46@5%"1).
S465%% // per il '() di semctl
A46@5% //3estituisce il )alore del semaforo specificato (args & *).
A465%% //Scri)e nell>array il )alore di >tutti> i semafori 8semctl(semid" *" A465%%" result).
012+3<0= //3imuo)e un array di semafori (semnum & *" args & *).
int shmget(key_t key, si%e_t si%e, int semflg);
shmid & shmget(S<B4C" sizeof(stacD)" 012+23456 7 *.**)!
void *shmat(int shmid, const void *shmaddr, int shmflg);
EFsG s & (stacD F)shmat(shmid" #$%%" *)! #$%% & sceglie S9 a cos attaccarl.
int shmdt(const void *shmaddr)! shmdt(s)!
struct sem&#f H
ushort sem+num! // semaforo dellIarray su cui operare
short sem+op! // numero intero(operazione da compiere)
short sem+flg! // opzioni
J
typedef struct H
long tipo! // categoria del messaggio
... mte(t ... // contenuto del messaggio (int dato! char nome! ecc...)
J msgtype!
msgtype m!

Das könnte Ihnen auch gefallen