Suche senden
Hochladen
Sysprog 16
•
Als ODP, PDF herunterladen
•
1 gefällt mir
•
1,528 views
Ahmed Mekkawy
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 33
Jetzt herunterladen
Empfohlen
Character drivers
Character drivers
pradeep_tewani
Linux Serial Driver
Linux Serial Driver
艾鍗科技
I2c drivers
I2c drivers
Pradeep Tewani
Linux Timer device driver
Linux Timer device driver
艾鍗科技
Kernel Process Management
Kernel Process Management
pradeep_tewani
Kernel Timing Management
Kernel Timing Management
pradeep_tewani
Linux dma engine
Linux dma engine
pradeep_tewani
Linux PCI device driver
Linux PCI device driver
艾鍗科技
Empfohlen
Character drivers
Character drivers
pradeep_tewani
Linux Serial Driver
Linux Serial Driver
艾鍗科技
I2c drivers
I2c drivers
Pradeep Tewani
Linux Timer device driver
Linux Timer device driver
艾鍗科技
Kernel Process Management
Kernel Process Management
pradeep_tewani
Kernel Timing Management
Kernel Timing Management
pradeep_tewani
Linux dma engine
Linux dma engine
pradeep_tewani
Linux PCI device driver
Linux PCI device driver
艾鍗科技
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Kevin Lo
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
HPC Essentials
HPC Essentials
William Brouwer
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Block Drivers
Block Drivers
Anil Kumar Pugalia
Kernel Timing Management
Kernel Timing Management
SysPlay eLearning Academy for You
Challenges in GPU compilers
Challenges in GPU compilers
AnastasiaStulova
Linux Porting
Linux Porting
Champ Yen
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Linux Internals Part - 3
Linux Internals Part - 3
SysPlay eLearning Academy for You
gcc and friends
gcc and friends
Anil Kumar Pugalia
Linux DMA Engine
Linux DMA Engine
SysPlay eLearning Academy for You
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Signals
Signals
Anil Kumar Pugalia
Chapter 3
Chapter 3
lopjuan
Unit 5
Unit 5
siddr
Weitere ähnliche Inhalte
Was ist angesagt?
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Kevin Lo
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
HPC Essentials
HPC Essentials
William Brouwer
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Block Drivers
Block Drivers
Anil Kumar Pugalia
Kernel Timing Management
Kernel Timing Management
SysPlay eLearning Academy for You
Challenges in GPU compilers
Challenges in GPU compilers
AnastasiaStulova
Linux Porting
Linux Porting
Champ Yen
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Linux Internals Part - 3
Linux Internals Part - 3
SysPlay eLearning Academy for You
gcc and friends
gcc and friends
Anil Kumar Pugalia
Linux DMA Engine
Linux DMA Engine
SysPlay eLearning Academy for You
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Signals
Signals
Anil Kumar Pugalia
Was ist angesagt?
(20)
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Audio Drivers
Audio Drivers
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
Arm device tree and linux device drivers
Arm device tree and linux device drivers
HPC Essentials
HPC Essentials
Shell Scripting
Shell Scripting
Threads
Threads
Network Drivers
Network Drivers
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
Block Drivers
Block Drivers
Kernel Timing Management
Kernel Timing Management
Challenges in GPU compilers
Challenges in GPU compilers
Linux Porting
Linux Porting
Linux Network Management
Linux Network Management
Synchronization
Synchronization
Linux Internals Part - 3
Linux Internals Part - 3
gcc and friends
gcc and friends
Linux DMA Engine
Linux DMA Engine
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
Signals
Signals
Andere mochten auch
Chapter 3
Chapter 3
lopjuan
Unit 5
Unit 5
siddr
Unit 7
Unit 7
siddr
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
techbed
Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
Addressing modes
Addressing modes
Mahesh Kumar Attri
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Saumitra Rukmangad
Andere mochten auch
(7)
Chapter 3
Chapter 3
Unit 5
Unit 5
Unit 7
Unit 7
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
Addressing modes of 8051
Addressing modes of 8051
Addressing modes
Addressing modes
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Ähnlich wie Sysprog 16
Sysprog17
Sysprog17
Ahmed Mekkawy
Introduction to Kernel Programming
Introduction to Kernel Programming
Ahmed Mekkawy
Confraria Security & IT - Lisbon Set 29, 2011
Confraria Security & IT - Lisbon Set 29, 2011
ricardomcm
C Language Unit-5
C Language Unit-5
kasaragadda srinivasrao
Unit5 (2)
Unit5 (2)
mrecedu
Unit 8
Unit 8
siddr
Unit 3
Unit 3
siddr
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Linux
Linux
keydak11
Unit5 C
Unit5 C
arnold 7490
Programming in C
Programming in C
sujathavvv
Programming in C
Programming in C
eswarisriram
Unit 6
Unit 6
siddr
Char Drivers And Debugging Techniques
Char Drivers And Debugging Techniques
YourHelper1
slides3_077.ppt
slides3_077.ppt
DEEPAK948083
C for Java programmers (part 1)
C for Java programmers (part 1)
Dmitry Zinoviev
The Rust Programming Language: an Overview
The Rust Programming Language: an Overview
Roberto Casadei
FreeBSD and Drivers
FreeBSD and Drivers
Kernel TLV
Sysprog 11
Sysprog 11
Ahmed Mekkawy
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
ajay1317
Ähnlich wie Sysprog 16
(20)
Sysprog17
Sysprog17
Introduction to Kernel Programming
Introduction to Kernel Programming
Confraria Security & IT - Lisbon Set 29, 2011
Confraria Security & IT - Lisbon Set 29, 2011
C Language Unit-5
C Language Unit-5
Unit5 (2)
Unit5 (2)
Unit 8
Unit 8
Unit 3
Unit 3
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Linux
Linux
Unit5 C
Unit5 C
Programming in C
Programming in C
Programming in C
Programming in C
Unit 6
Unit 6
Char Drivers And Debugging Techniques
Char Drivers And Debugging Techniques
slides3_077.ppt
slides3_077.ppt
C for Java programmers (part 1)
C for Java programmers (part 1)
The Rust Programming Language: an Overview
The Rust Programming Language: an Overview
FreeBSD and Drivers
FreeBSD and Drivers
Sysprog 11
Sysprog 11
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
Mehr von Ahmed Mekkawy
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Ahmed Mekkawy
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Ahmed Mekkawy
OpenData for governments
OpenData for governments
Ahmed Mekkawy
Infrastructure as a Code
Infrastructure as a Code
Ahmed Mekkawy
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
Ahmed Mekkawy
Everything is a Game
Everything is a Game
Ahmed Mekkawy
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
Ahmed Mekkawy
FOSS Enterpreneurship
FOSS Enterpreneurship
Ahmed Mekkawy
Intro to FOSS & using it in development
Intro to FOSS & using it in development
Ahmed Mekkawy
FOSS, history and philosophy
FOSS, history and philosophy
Ahmed Mekkawy
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud Compting
Ahmed Mekkawy
A look at computer security
A look at computer security
Ahmed Mekkawy
Networking in Gnu/Linux
Networking in Gnu/Linux
Ahmed Mekkawy
Foss Movement In Egypt
Foss Movement In Egypt
Ahmed Mekkawy
Sysprog 15
Sysprog 15
Ahmed Mekkawy
Sysprog 9
Sysprog 9
Ahmed Mekkawy
Sysprog 12
Sysprog 12
Ahmed Mekkawy
Sysprog 14
Sysprog 14
Ahmed Mekkawy
Sysprog 7
Sysprog 7
Ahmed Mekkawy
Sysprog 8
Sysprog 8
Ahmed Mekkawy
Mehr von Ahmed Mekkawy
(20)
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
OpenData for governments
OpenData for governments
Infrastructure as a Code
Infrastructure as a Code
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
Everything is a Game
Everything is a Game
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
FOSS Enterpreneurship
FOSS Enterpreneurship
Intro to FOSS & using it in development
Intro to FOSS & using it in development
FOSS, history and philosophy
FOSS, history and philosophy
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud Compting
A look at computer security
A look at computer security
Networking in Gnu/Linux
Networking in Gnu/Linux
Foss Movement In Egypt
Foss Movement In Egypt
Sysprog 15
Sysprog 15
Sysprog 9
Sysprog 9
Sysprog 12
Sysprog 12
Sysprog 14
Sysprog 14
Sysprog 7
Sysprog 7
Sysprog 8
Sysprog 8
Kürzlich hochgeladen
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
UiPathCommunity
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
The Digital Insurer
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Rustici Software
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
Overkill Security
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
apidays
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
apidays
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
Kürzlich hochgeladen
(20)
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Sysprog 16
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
int echo_main(int argc,
char **argv) { struct iovec io[argc]; struct iovec *cur_io = io; char *arg; char *p; ... while (1) { int c; cur_io->iov_base = p = arg; ... while ((c = *arg++)) { if (c == eflag) { /* Check for escape seq. */ if (*arg == 'c') { /* '' means cancel newline and ignore all subsequent chars. */ cur_io->iov_len = p - (char*)cur_io->iov_base; cur_io++; goto ret; } ... c = bb_process_escape_sequence( (void*) &arg); } *p++ = c; } arg = *++argv; if (arg) *p++ = ' '; cur_io->iov_len = p - (char*)cur_io->iov_base; cur_io++; if (!arg) break; } ret: return writev(1, io, (cur_io - io)) >= 0; }
15.
16.
17.
18.
#ifdef F_SETLK #ifndef
SEEK_SET #define SEEK_SET 0 #endif struct flock lock_data; lock_data.l_type = F_WRLCK; lock_data.l_whence = SEEK_SET; lock_data.l_start = lock_data.l_len = 0; if (fcntl(pidFd, F_SETLK, &lock_data) == -1) { if (errno == EAGAIN) return oldpid; else return -1; } #else #ifdef LOCK_EX if (flock (pidFd, LOCK_EX|LOCK_NB) == -1) { if (errno == EWOULDBLOCK) return oldpid; else return -1; } #else if (lockf (pidFd, F_TLOCK, 0) == -1) { if (errno == EACCES) return oldpid; else return -1; } #endif #endif }
19.
20.
21.
22.
23.
24.
25.
26.
static pid_list *scan_proc_pids(inode_list
*ilist) { DIR *d; struct dirent *de; pid_t pid; pid_list *plist; xchdir("/proc"); d = opendir("/proc"); if (!d) return NULL; plist = NULL; while ((de = readdir(d)) != NULL) { pid = (pid_t)bb_strtou(de->d_name, NULL, 10); if (errno) continue; if (chdir(de->d_name) < 0) continue; plist = scan_link("cwd", pid, ilist, plist); plist = scan_link("exe", pid, ilist, plist); plist = scan_link("root", pid, ilist, plist); .... } closedir(d); return plist; } static pid_list *scan_link(const char *lname, pid_t pid, inode_list *ilist, pid_list *plist) { ino_t inode; dev_t dev; if (!file_to_dev_inode(lname, &dev, &inode)) return plist; if (search_dev_inode(ilist, dev, inode)) plist = add_pid(plist, pid); return plist; } static int file_to_dev_inode(const char *filename, dev_t *dev, ino_t *inode) { struct stat f_stat; if (stat(filename, &f_stat)) return 0; *inode = f_stat.st_ino; *dev = f_stat.st_dev; return 1; } static int search_dev_inode(inode_list *ilist, dev_t dev, ino_t inode) { while (ilist) { if (ilist->dev == dev) { if (option_mask32 & OPT_MOUNT) return 1; if (ilist->inode == inode) return 1; } ilist = ilist->next; } return 0; }
27.
28.
29.
30.
31.
32.
int inotifyd_main(int argc
UNUSED_PARAM, char **argv) { unsigned mask = IN_ALL_EVENTS; // assume we want all events struct pollfd pfd; char **watched = ++argv; // watched name list const char *args[] = { *argv, NULL, NULL, NULL, NULL }; // open inotify pfd.fd = inotify_init(); if (pfd.fd < 0) bb_perror_msg_and_die("no kernel support"); // setup watched while (*++argv) { char *path = *argv; char *masks = strchr(path, ':'); int wd; // watch descriptor // if mask is specified -> if (masks) { *masks = ''; // split path and mask // convert mask names to mask bitset mask = 0; while (*++masks) { int i = strchr(mask_names, *masks) - mask_names; if (i >= 0) { mask |= (1 << i); } } } // add watch wd = inotify_add_watch(pfd.fd, path, mask); if (wd < 0) { bb_perror_msg_and_die("add watch (%s) failed", path); } } static const char mask_names[] ALIGN1 = "a" // 0x00000001 File was accessed "c" // 0x00000002 File was modified "e" // 0x00000004 Metadata changed "w" // 0x00000008 Writtable file was closed "0" // 0x00000010 Unwrittable file closed "r" // 0x00000020 File was opened "m" // 0x00000040 File was moved from X "y" // 0x00000080 File was moved to Y "n" // 0x00000100 Subfile was created "d" // 0x00000200 Subfile was deleted "D" // 0x00000400 Self was deleted "M" // 0x00000800 Self was moved ; pfd.events = POLLIN; while (!signalled && poll(&pfd, 1, -1) > 0) { ssize_t len; void *buf; struct inotify_event *ie; // read out all pending events xioctl(pfd.fd, FIONREAD, &len); #define eventbuf bb_common_bufsiz1 ie = buf = (len <= sizeof(eventbuf)) ? eventbuf : xmalloc(len); len = full_read(pfd.fd, buf, len); // process events. N.B. events may vary in length while (len > 0) { int i; char events[12]; char *s = events; unsigned m = ie->mask; for (i = 0; i < 12; ++i, m >>= 1) { if (m & 1) { *s++ = mask_names[i]; } } *s = ''; args[1] = events; args[2] = watched[ie->wd]; args[3] = ie->len ? ie->name : NULL; xspawn((char **)args); // next event i = sizeof(struct inotify_event) + ie->len; len -= i; ie = (void*)((char*)ie + i); } if (eventbuf != buf) free(buf); } return EXIT_SUCCESS; }
33.
Jetzt herunterladen