SlideShare a Scribd company logo
C/C++ Linux System Programming ,[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object]
IPC Mechanisms So Far ,[object Object],[object Object],[object Object]
Pipes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
struct job *jp; struct nodelist *lp; int pipelen; int prevfd; int pip[2]; prevfd = -1; for (lp = n->npipe.cmdlist; lp; lp = lp->next) { ... pip[1] = -1; if (lp->next) { if (pipe(pip) < 0) { ... } } if (forkshell(jp, lp->n, n->npipe.pipe_backgnd) == 0) { ... if (pip[1] >= 0) { close(pip[0]); } if (prevfd > 0) { dup2(prevfd, 0); close(prevfd); } if (pip[1] > 1) { dup2(pip[1], 1); close(pip[1]); } /* Execute */ /* never returns */ } if (prevfd >= 0) close(prevfd); prevfd = pip[0]; close(pip[1]); }
FIFOs ,[object Object],[object Object],[object Object],[object Object]
SysV Generic ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SysV Semaphores ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semaphore control ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semaphore Ops ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SysV Messages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Msg Receival ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SysV Shared Memory ,[object Object],[object Object],[object Object],[object Object],[object Object]
static void ipcsyslog_init(void) { if (DEBUG) printf(&quot;shmget(%x, %d,...)&quot;, (int)KEY_ID, G.shm_size); G.shmid = shmget(KEY_ID, G.shm_size, IPC_CREAT | 0644); if (G.shmid == -1) { bb_perror_msg_and_die(&quot;shmget&quot;); } G.shbuf = shmat(G.shmid, NULL, 0); if (G.shbuf == (void*) -1L) { /* shmat has bizarre error return */ bb_perror_msg_and_die(&quot;shmat&quot;); } memset(G.shbuf, 0, G.shm_size); G.shbuf->size = G.shm_size - offsetof(struct shbuf_ds, data) - 1; /*G.shbuf->tail = 0;*/ // we'll trust the OS to set initial semval to 0 (let's hope) G.s_semid = semget(KEY_ID, 2, IPC_CREAT | IPC_EXCL | 1023); if (G.s_semid == -1) { if (errno == EEXIST) { G.s_semid = semget(KEY_ID, 2, 0); if (G.s_semid != -1) return; } bb_perror_msg_and_die(&quot;semget&quot;); } } static void log_to_shmem(const char *msg, int len) { int old_tail, new_tail; if (semop(G.s_semid, G.SMwdn, 3) == -1) { bb_perror_msg_and_die(&quot;SMwdn&quot;); } ... /* Circular buffer calculation */ memcpy(G.shbuf->data + old_tail, msg, k); if (semop(G.s_semid, G.SMwup, 1) == -1) { bb_perror_msg_and_die(&quot;SMwup&quot;); } } static void ipcsyslog_cleanup(void) { if (G.shmid != -1) { shmdt(G.shbuf); } if (G.shmid != -1) { shmctl(G.shmid, IPC_RMID, NULL); } if (G.s_semid != -1) { semctl(G.s_semid, 0, IPC_RMID, 0); } }
POSIX Generic ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
POSIX Semaphores ,[object Object],[object Object],[object Object],[object Object]
Semaphore Ops ,[object Object],[object Object],[object Object],[object Object],[object Object]
POSIX Message Queues ,[object Object],[object Object],[object Object],[object Object],[object Object]
Mq Attributes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
POSIX Shared Memory ,[object Object],[object Object],[object Object]
Memory Mapping for Shared memory ,[object Object],[object Object],[object Object]
POSIX shm example int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) { char fn[32]; int fd = -1; struct shm_marker *marker; pa_random(&m->id, sizeof(m->id)); segment_name(fn, sizeof(fn), m->id); if ((fd = shm_open(fn, O_RDWR|O_CREAT|O_EXCL, mode & 0444)) < 0) { ... } m->size = size + PA_ALIGN(sizeof(struct shm_marker)); if (ftruncate(fd, m->size) < 0) { ...  } if ((m->ptr = mmap(NULL, m->size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { ... } marker = (struct shm_marker*) ((uint8_t*) m->ptr + m->size -   PA_ALIGN(sizeof(struct shm_marker))); pa_atomic_store(&marker->pid, (int) getpid()); pa_atomic_store(&marker->marker, SHM_MARKER); ... m->do_unlink = 1; } void pa_shm_free(pa_shm *m) { ... if (munmap(m->ptr, m->size) < 0) pa_log(&quot;munmap() failed: %s&quot;, pa_cstrerror(errno)); if (m->do_unlink) { char fn[32]; segment_name(fn, sizeof(fn), m->id); if (shm_unlink(fn) < 0) pa_log(&quot; shm_unlink(%s) failed: %s&quot;, fn, pa_cstrerror(errno)); } ... memset(m, 0, sizeof(*m)); } struct shm_marker { pa_atomic_t marker; /* 0xbeefcafe */ pa_atomic_t pid; void *_reserverd1; void *_reserverd2; void *_reserverd3; void *_reserverd4; }; static char *segment_name(char *fn, size_t l, unsigned id) { pa_snprintf(fn, l, &quot;/pulse-shm-%u&quot;, id); return fn; }
struct pa_semaphore { sem_t sem; }; pa_semaphore* pa_semaphore_new(unsigned value) { pa_semaphore *s; s = pa_xnew(pa_semaphore, 1); &s->sem, 0, value); return s; } void pa_semaphore_free(pa_semaphore *s) { sem_destroy(&s->sem) ; } void pa_semaphore_post(pa_semaphore *s) { sem_post(&s->sem) ; } void pa_semaphore_wait(pa_semaphore *s) { int ret; do { ret = sem_wait(&s->sem); } while (ret < 0 && errno == EINTR); } pa_mempool* pa_mempool_new(int shared) { pa_mempool *p; ... p = pa_xnew(pa_mempool, 1); p->semaphore = pa_semaphore_new(0); p->block_size = PA_PAGE_ALIGN(PA_MEMPOOL_SLOT_SIZE); ... if (pa_shm_create_rw(&p->memory, p->n_blocks * p->block_size, shared, 0700) < 0) { } ... return p; } void pa_mempool_free(pa_mempool *p) { ... pa_shm_free(&p->memory); ... pa_semaphore_free(p->semaphore); pa_xfree(p); } static void memblock_wait(pa_memblock *b) { if (pa_atomic_load(&b->n_acquired) > 0) { pa_atomic_inc(&b->please_signal); while (pa_atomic_load(&b->n_acquired) > 0) pa_semaphore_wait(b->pool->semaphore); pa_atomic_dec(&b->please_signal); } } void pa_memblock_release(pa_memblock *b) { int r; r = pa_atomic_dec(&b->n_acquired); pa_assert(r >= 1); if (r == 1 && pa_atomic_load(&b->please_signal)) pa_semaphore_post(b->pool->semaphore); }

More Related Content

What's hot

ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“уITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
delimitry
Ā 
Open bot
Open bot Open bot
Open bot
Anshuman Dhar
Ā 
Tgh.pl
Tgh.plTgh.pl
Tgh.pliskabom
Ā 
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
Functional Thursday
Ā 
C for Java programmers (part 1)
C for Java programmers (part 1)C for Java programmers (part 1)
C for Java programmers (part 1)
Dmitry Zinoviev
Ā 
Process management
Process managementProcess management
Process management
Utkarsh Kulshrestha
Ā 
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
CODE BLUE
Ā 
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas MacFlashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
ESET LatinoamƩrica
Ā 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
Ā 
Usp
UspUsp
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Yandex
Ā 
Gps c
Gps cGps c
Qt Rest Server
Qt Rest ServerQt Rest Server
Qt Rest Server
Vasiliy Sorokin
Ā 
Grand Central Dispatch in Objective-C
Grand Central Dispatch in Objective-CGrand Central Dispatch in Objective-C
Grand Central Dispatch in Objective-C
Pavel Albitsky
Ā 
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
Iosif Itkin
Ā 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Michael Barker
Ā 
Embedding perl
Embedding perlEmbedding perl
Embedding perl
Marian Marinov
Ā 

What's hot (20)

ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“уITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
ITGM #9 - ŠšŠ¾Š²Š°Ń€Š½Ń‹Š¹ CodeType, ŠøŠ»Šø Š¾Ń‚ segfault'Š° Šŗ рŠ°Š±Š¾Ń‚Š°ŃŽŃ‰ŠµŠ¼Ńƒ ŠŗŠ¾Š“у
Ā 
Open bot
Open bot Open bot
Open bot
Ā 
R tist
R tistR tist
R tist
Ā 
Bluespec @waseda
Bluespec @wasedaBluespec @waseda
Bluespec @waseda
Ā 
Tgh.pl
Tgh.plTgh.pl
Tgh.pl
Ā 
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
[FT-11][suhorng] ā€œPoor Man'sā€ Undergraduate Compilers
Ā 
Sysprog 14
Sysprog 14Sysprog 14
Sysprog 14
Ā 
C for Java programmers (part 1)
C for Java programmers (part 1)C for Java programmers (part 1)
C for Java programmers (part 1)
Ā 
Process management
Process managementProcess management
Process management
Ā 
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits怀 by Seok-Ha Lee (wh1ant)
Ā 
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas MacFlashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas Mac
Ā 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Ā 
Usp
UspUsp
Usp
Ā 
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Š”тŠµŠæŠ°Š½ ŠšŠ¾Š»ŃŒŃ†Š¾Š² ā€” Rust ā€” Š»ŃƒŃ‡ŃˆŠµ, чŠµŠ¼ C++
Ā 
Gps c
Gps cGps c
Gps c
Ā 
Qt Rest Server
Qt Rest ServerQt Rest Server
Qt Rest Server
Ā 
Grand Central Dispatch in Objective-C
Grand Central Dispatch in Objective-CGrand Central Dispatch in Objective-C
Grand Central Dispatch in Objective-C
Ā 
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
Ā 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
Ā 
Embedding perl
Embedding perlEmbedding perl
Embedding perl
Ā 

Viewers also liked

Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ahmed Mekkawy
Ā 
OpenData for governments
OpenData for governmentsOpenData for governments
OpenData for governments
Ahmed Mekkawy
Ā 
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Ahmed Mekkawy
Ā 
Infrastructure as a Code
Infrastructure as a Code Infrastructure as a Code
Infrastructure as a Code
Ahmed Mekkawy
Ā 
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understandEncrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Ahmed Mekkawy
Ā 
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
Justo Carretero
Ā 
FOSS Enterpreneurship
FOSS EnterpreneurshipFOSS Enterpreneurship
FOSS Enterpreneurship
Ahmed Mekkawy
Ā 
Foss Movement In Egypt
Foss Movement In EgyptFoss Movement In Egypt
Foss Movement In Egypt
Ahmed Mekkawy
Ā 
Sysprog17
Sysprog17Sysprog17
Sysprog17
Ahmed Mekkawy
Ā 
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS wayWhy Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
Ahmed Mekkawy
Ā 
Intro to FOSS & using it in development
Intro to FOSS & using it in developmentIntro to FOSS & using it in development
Intro to FOSS & using it in development
Ahmed Mekkawy
Ā 
Everything is a Game
Everything is a GameEverything is a Game
Everything is a Game
Ahmed Mekkawy
Ā 
Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/LinuxAhmed Mekkawy
Ā 

Viewers also liked (20)

Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ų“Ų±ŁƒŲ© Ų³ŲØŁŠŲ±ŁˆŁ„Ų§ Ł„Ł„Ų£Ł†ŲøŁ…Ų© ŁˆŲ§Ł„Ų¬Ł…Ų¹ŁŠŲ© Ų§Ł„Ł…ŲµŲ±ŁŠŲ© Ł„Ł„Ł…ŲµŲ§ŲÆŲ± Ų§Ł„Ł…ŁŲŖŁˆŲ­Ų©
Ā 
OpenData for governments
OpenData for governmentsOpenData for governments
OpenData for governments
Ā 
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Ā 
Infrastructure as a Code
Infrastructure as a Code Infrastructure as a Code
Infrastructure as a Code
Ā 
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understandEncrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Ā 
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
111214 ineco justo_cp_monitoreo_cancunshmii5-eng_v1
Ā 
FOSS Enterpreneurship
FOSS EnterpreneurshipFOSS Enterpreneurship
FOSS Enterpreneurship
Ā 
Sysprog 7
Sysprog 7Sysprog 7
Sysprog 7
Ā 
Foss Movement In Egypt
Foss Movement In EgyptFoss Movement In Egypt
Foss Movement In Egypt
Ā 
Sysprog 16
Sysprog 16Sysprog 16
Sysprog 16
Ā 
Sysprog17
Sysprog17Sysprog17
Sysprog17
Ā 
Sysprog 15
Sysprog 15Sysprog 15
Sysprog 15
Ā 
Sysprog 12
Sysprog 12Sysprog 12
Sysprog 12
Ā 
Sysprog 10
Sysprog 10Sysprog 10
Sysprog 10
Ā 
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS wayWhy Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
Ā 
Intro to FOSS & using it in development
Intro to FOSS & using it in developmentIntro to FOSS & using it in development
Intro to FOSS & using it in development
Ā 
Sysprog 8
Sysprog 8Sysprog 8
Sysprog 8
Ā 
Everything is a Game
Everything is a GameEverything is a Game
Everything is a Game
Ā 
Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/Linux
Ā 
Sysprog 11
Sysprog 11Sysprog 11
Sysprog 11
Ā 

Similar to Sysprog 13

Sysprog 12
Sysprog 12Sysprog 12
Sysprog 12
Ahmed Mekkawy
Ā 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdf
clarityvision
Ā 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321Teddy Hsiung
Ā 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
aptcomputerzone
Ā 
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdfoperating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
aquazac
Ā 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel Programming
Ahmed Mekkawy
Ā 
LLVM Backend 恮ē“¹ä»‹
LLVM Backend 恮ē“¹ä»‹LLVM Backend 恮ē“¹ä»‹
LLVM Backend 恮ē“¹ä»‹
Akira Maruoka
Ā 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
PVS-Studio
Ā 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Andrey Karpov
Ā 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationEmery Berger
Ā 
Unit 6
Unit 6Unit 6
Unit 6siddr
Ā 
Unit 4
Unit 4Unit 4
Unit 4siddr
Ā 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
odiliagilby
Ā 
Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6fisher.w.y
Ā 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
Yung-Yu Chen
Ā 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo
Ā 
Hooking signals and dumping the callstack
Hooking signals and dumping the callstackHooking signals and dumping the callstack
Hooking signals and dumping the callstack
Thierry Gayet
Ā 
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Platonov Sergey
Ā 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
Ā 

Similar to Sysprog 13 (20)

Sysprog 12
Sysprog 12Sysprog 12
Sysprog 12
Ā 
Shell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdfShell to be modified#include stdlib.h #include unistd.h .pdf
Shell to be modified#include stdlib.h #include unistd.h .pdf
Ā 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
Ā 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
Ā 
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdfoperating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
Ā 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel Programming
Ā 
LLVM Backend 恮ē“¹ä»‹
LLVM Backend 恮ē“¹ä»‹LLVM Backend 恮ē“¹ä»‹
LLVM Backend 恮ē“¹ä»‹
Ā 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Ā 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Ā 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance Evaluation
Ā 
Unit 6
Unit 6Unit 6
Unit 6
Ā 
Unit 4
Unit 4Unit 4
Unit 4
Ā 
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
__MACOSX._assign3assign3.DS_Store__MACOSXassign3._.D.docx
Ā 
Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6
Ā 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
Ā 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Ā 
Hooking signals and dumping the callstack
Hooking signals and dumping the callstackHooking signals and dumping the callstack
Hooking signals and dumping the callstack
Ā 
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠšŃ€ŃƒŃ‚ŃŒŠŗŠ¾, ŠœŠ½Š¾Š³Š¾ŠæŠ¾Ń‚Š¾Ń‡Š½Ń‹Šµ Š²Ń‹Ń‡ŠøсŠ»ŠµŠ½Šøя, сŠ¾Š²Ń€ŠµŠ¼ŠµŠ½Š½Ń‹Š¹ ŠæŠ¾Š“хŠ¾Š“.
Ā 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
Ā 
Vcs16
Vcs16Vcs16
Vcs16
Ā 

More from Ahmed Mekkawy

FOSS, history and philosophy
FOSS, history and philosophyFOSS, history and philosophy
FOSS, history and philosophy
Ahmed Mekkawy
Ā 
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud ComptingVirtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud ComptingAhmed Mekkawy
Ā 
A look at computer security
A look at computer securityA look at computer security
A look at computer securityAhmed Mekkawy
Ā 
Packet Filtering Using Iptables
Packet Filtering Using IptablesPacket Filtering Using Iptables
Packet Filtering Using IptablesAhmed Mekkawy
Ā 
Foss Presentation
Foss PresentationFoss Presentation
Foss PresentationAhmed Mekkawy
Ā 
sysprog3 Part2
sysprog3 Part2sysprog3 Part2
sysprog3 Part2
Ahmed Mekkawy
Ā 
sysprog2 Part2
sysprog2 Part2sysprog2 Part2
sysprog2 Part2
Ahmed Mekkawy
Ā 

More from Ahmed Mekkawy (9)

FOSS, history and philosophy
FOSS, history and philosophyFOSS, history and philosophy
FOSS, history and philosophy
Ā 
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud ComptingVirtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud Compting
Ā 
A look at computer security
A look at computer securityA look at computer security
A look at computer security
Ā 
Sysprog 9
Sysprog 9Sysprog 9
Sysprog 9
Ā 
Sysprog 10
Sysprog 10Sysprog 10
Sysprog 10
Ā 
Packet Filtering Using Iptables
Packet Filtering Using IptablesPacket Filtering Using Iptables
Packet Filtering Using Iptables
Ā 
Foss Presentation
Foss PresentationFoss Presentation
Foss Presentation
Ā 
sysprog3 Part2
sysprog3 Part2sysprog3 Part2
sysprog3 Part2
Ā 
sysprog2 Part2
sysprog2 Part2sysprog2 Part2
sysprog2 Part2
Ā 

Recently uploaded

Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
UiPathCommunity
Ā 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
Ā 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
Ā 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
Ā 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
Ā 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
Ā 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
Ā 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
Ā 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
Ā 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
Ā 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
Ā 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
Ā 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
Ā 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
Ā 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
Ā 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
Ā 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
Ā 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
Ā 

Recently uploaded (20)

Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder ā€“ active learning and UiPath LLMs for do...
Ā 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
Ā 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Ā 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
Ā 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Ā 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Ā 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Ā 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ā 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Ā 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Ā 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Ā 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Ā 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
Ā 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Ā 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
Ā 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Ā 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Ā 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ā 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Ā 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Ā 

Sysprog 13

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. struct job *jp; struct nodelist *lp; int pipelen; int prevfd; int pip[2]; prevfd = -1; for (lp = n->npipe.cmdlist; lp; lp = lp->next) { ... pip[1] = -1; if (lp->next) { if (pipe(pip) < 0) { ... } } if (forkshell(jp, lp->n, n->npipe.pipe_backgnd) == 0) { ... if (pip[1] >= 0) { close(pip[0]); } if (prevfd > 0) { dup2(prevfd, 0); close(prevfd); } if (pip[1] > 1) { dup2(pip[1], 1); close(pip[1]); } /* Execute */ /* never returns */ } if (prevfd >= 0) close(prevfd); prevfd = pip[0]; close(pip[1]); }
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. static void ipcsyslog_init(void) { if (DEBUG) printf(&quot;shmget(%x, %d,...)&quot;, (int)KEY_ID, G.shm_size); G.shmid = shmget(KEY_ID, G.shm_size, IPC_CREAT | 0644); if (G.shmid == -1) { bb_perror_msg_and_die(&quot;shmget&quot;); } G.shbuf = shmat(G.shmid, NULL, 0); if (G.shbuf == (void*) -1L) { /* shmat has bizarre error return */ bb_perror_msg_and_die(&quot;shmat&quot;); } memset(G.shbuf, 0, G.shm_size); G.shbuf->size = G.shm_size - offsetof(struct shbuf_ds, data) - 1; /*G.shbuf->tail = 0;*/ // we'll trust the OS to set initial semval to 0 (let's hope) G.s_semid = semget(KEY_ID, 2, IPC_CREAT | IPC_EXCL | 1023); if (G.s_semid == -1) { if (errno == EEXIST) { G.s_semid = semget(KEY_ID, 2, 0); if (G.s_semid != -1) return; } bb_perror_msg_and_die(&quot;semget&quot;); } } static void log_to_shmem(const char *msg, int len) { int old_tail, new_tail; if (semop(G.s_semid, G.SMwdn, 3) == -1) { bb_perror_msg_and_die(&quot;SMwdn&quot;); } ... /* Circular buffer calculation */ memcpy(G.shbuf->data + old_tail, msg, k); if (semop(G.s_semid, G.SMwup, 1) == -1) { bb_perror_msg_and_die(&quot;SMwup&quot;); } } static void ipcsyslog_cleanup(void) { if (G.shmid != -1) { shmdt(G.shbuf); } if (G.shmid != -1) { shmctl(G.shmid, IPC_RMID, NULL); } if (G.s_semid != -1) { semctl(G.s_semid, 0, IPC_RMID, 0); } }
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. POSIX shm example int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) { char fn[32]; int fd = -1; struct shm_marker *marker; pa_random(&m->id, sizeof(m->id)); segment_name(fn, sizeof(fn), m->id); if ((fd = shm_open(fn, O_RDWR|O_CREAT|O_EXCL, mode & 0444)) < 0) { ... } m->size = size + PA_ALIGN(sizeof(struct shm_marker)); if (ftruncate(fd, m->size) < 0) { ... } if ((m->ptr = mmap(NULL, m->size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) { ... } marker = (struct shm_marker*) ((uint8_t*) m->ptr + m->size - PA_ALIGN(sizeof(struct shm_marker))); pa_atomic_store(&marker->pid, (int) getpid()); pa_atomic_store(&marker->marker, SHM_MARKER); ... m->do_unlink = 1; } void pa_shm_free(pa_shm *m) { ... if (munmap(m->ptr, m->size) < 0) pa_log(&quot;munmap() failed: %s&quot;, pa_cstrerror(errno)); if (m->do_unlink) { char fn[32]; segment_name(fn, sizeof(fn), m->id); if (shm_unlink(fn) < 0) pa_log(&quot; shm_unlink(%s) failed: %s&quot;, fn, pa_cstrerror(errno)); } ... memset(m, 0, sizeof(*m)); } struct shm_marker { pa_atomic_t marker; /* 0xbeefcafe */ pa_atomic_t pid; void *_reserverd1; void *_reserverd2; void *_reserverd3; void *_reserverd4; }; static char *segment_name(char *fn, size_t l, unsigned id) { pa_snprintf(fn, l, &quot;/pulse-shm-%u&quot;, id); return fn; }
  • 23. struct pa_semaphore { sem_t sem; }; pa_semaphore* pa_semaphore_new(unsigned value) { pa_semaphore *s; s = pa_xnew(pa_semaphore, 1); &s->sem, 0, value); return s; } void pa_semaphore_free(pa_semaphore *s) { sem_destroy(&s->sem) ; } void pa_semaphore_post(pa_semaphore *s) { sem_post(&s->sem) ; } void pa_semaphore_wait(pa_semaphore *s) { int ret; do { ret = sem_wait(&s->sem); } while (ret < 0 && errno == EINTR); } pa_mempool* pa_mempool_new(int shared) { pa_mempool *p; ... p = pa_xnew(pa_mempool, 1); p->semaphore = pa_semaphore_new(0); p->block_size = PA_PAGE_ALIGN(PA_MEMPOOL_SLOT_SIZE); ... if (pa_shm_create_rw(&p->memory, p->n_blocks * p->block_size, shared, 0700) < 0) { } ... return p; } void pa_mempool_free(pa_mempool *p) { ... pa_shm_free(&p->memory); ... pa_semaphore_free(p->semaphore); pa_xfree(p); } static void memblock_wait(pa_memblock *b) { if (pa_atomic_load(&b->n_acquired) > 0) { pa_atomic_inc(&b->please_signal); while (pa_atomic_load(&b->n_acquired) > 0) pa_semaphore_wait(b->pool->semaphore); pa_atomic_dec(&b->please_signal); } } void pa_memblock_release(pa_memblock *b) { int r; r = pa_atomic_dec(&b->n_acquired); pa_assert(r >= 1); if (r == 1 && pa_atomic_load(&b->please_signal)) pa_semaphore_post(b->pool->semaphore); }