Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 591718 Details for
Bug 831900
system call sys_semget costs more time
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
calls semget in a while(1) statement
b.c (text/x-csrc), 944 bytes, created by
slh
on 2012-06-14 03:17:53 UTC
(
hide
)
Description:
calls semget in a while(1) statement
Filename:
MIME Type:
Creator:
slh
Created:
2012-06-14 03:17:53 UTC
Size:
944 bytes
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <errno.h> >#include <sys/ipc.h> >#include <sys/sem.h> >#include <sys/time.h> > >int InitSem(const key_t key, const int nsems) >{ > int i = 0; > if( (key <= 0) || (nsems <= 0) ) > { > return (-1); > } > > int sem_id = semget(key, 0, 0); > if( sem_id < 0 ) > { > sem_id = semget(key, nsems, IPC_CREAT|IPC_EXCL|0666); > if ( sem_id < 0) > { > if( errno == EEXIST ) > { > sem_id = semget(key, 0, 0); > return (sem_id); > } > else > { > return (-1); > } > } > else > { > for( i = 0; i < nsems; ++i ) > { > int status = semctl(sem_id, i, SETVAL); > if( status < 0 ) > { > return (-1); > } > } > > return (sem_id); > } > } > > return (sem_id); >} > > >int main(int argc ,char ** argv) >{ > key_t key = 6225; > int nsems = 2; > int sem_id = 0; > sem_id = InitSem(key, nsems); > > while(1) > { > sem_id = semget(key, 0, 0); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 831900
:
591717
| 591718