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 158364 Details for
Bug 246509
shmctl returns EIDRM when it should say EINVAL
[?]
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.
Test program to exercise the bug
shmctl-bug.c (text/plain), 2.06 KB, created by
Tom Lane
on 2007-07-02 18:55:47 UTC
(
hide
)
Description:
Test program to exercise the bug
Filename:
MIME Type:
Creator:
Tom Lane
Created:
2007-07-02 18:55:47 UTC
Size:
2.06 KB
patch
obsolete
>#include <sys/ipc.h> >#include <sys/shm.h> > >#include <errno.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> > >int >main(int argc, char *argv[]) >{ > int shmid1; > int shmid2; > int shmid3; > struct shmid_ds buf; > > /* make and stat 2 shmem segments */ > shmid1 = shmget(0x12345678, 1024 * 1024, IPC_CREAT | IPC_EXCL | 0600); > if (shmid1 < 0) > { > perror("shmget 1 failed"); > exit(1); > } > printf("id1 = %d / %#x\n", shmid1, shmid1); > > shmid2 = shmget(0x12345679, 1024 * 1024, IPC_CREAT | IPC_EXCL | 0600); > if (shmid2 < 0) > { > perror("shmget 2 failed"); > exit(1); > } > printf("id2 = %d / %#x\n", shmid2, shmid2); > > if (shmctl(shmid1, IPC_STAT, &buf) < 0) > { > printf("shmctl(%d / %#x, IPC_STAT): ERROR: %s\n", shmid1, shmid1, > strerror(errno)); > } > > if (shmctl(shmid2, IPC_STAT, &buf) < 0) > { > printf("shmctl(%d / %#x, IPC_STAT): ERROR: %s\n", shmid2, shmid2, > strerror(errno)); > } > > /* remove both */ > if (shmctl(shmid1, IPC_RMID, NULL) < 0) > { > printf("shmctl(%d / %#x, IPC_RMID): ERROR: %s\n", shmid1, shmid1, > strerror(errno)); > } > if (shmctl(shmid2, IPC_RMID, NULL) < 0) > { > printf("shmctl(%d / %#x, IPC_RMID): ERROR: %s\n", shmid2, shmid2, > strerror(errno)); > } > > /* make a third one */ > shmid3 = shmget(0x1234567A, 1024 * 1024, IPC_CREAT | IPC_EXCL | 0600); > if (shmid3 < 0) > { > perror("shmget 3 failed"); > exit(1); > } > printf("id3 = %d / %#x\n", shmid3, shmid3); > > /* now observe stat behavior for the two old IDs */ > > if (shmctl(shmid1, IPC_STAT, &buf) < 0) > { > printf("shmctl(%d / %#x, IPC_STAT): ERROR: %s\n", shmid1, shmid1, > strerror(errno)); > } > > if (shmctl(shmid2, IPC_STAT, &buf) < 0) > { > printf("shmctl(%d / %#x, IPC_STAT): ERROR: %s\n", shmid2, shmid2, > strerror(errno)); > } > > /* clean up by removing third segment */ > if (shmctl(shmid3, IPC_RMID, NULL) < 0) > { > printf("shmctl(%d / %#x, IPC_RMID): ERROR: %s\n", shmid3, shmid3, > strerror(errno)); > } > > return 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 246509
: 158364