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 304061 Details for
Bug 444560
accept(2) return EINVAL on s390x
[?]
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.
testr.c
testr.c (text/plain), 1.81 KB, created by
Qian Cai
on 2008-04-29 03:48:38 UTC
(
hide
)
Description:
testr.c
Filename:
MIME Type:
Creator:
Qian Cai
Created:
2008-04-29 03:48:38 UTC
Size:
1.81 KB
patch
obsolete
>#include <stdio.h> >#include <sys/select.h> >#include <sys/time.h> >#include <sys/types.h> >#include <unistd.h> >#include <sys/socket.h> >#include <fcntl.h> >#include <sys/un.h> >#include <errno.h> > >#define SOCKFILE "./.sockfile" >#define READSIZE (8) > >int main(int argc, int **argv) >{ > int rc; > int fds; > int newfds; > struct sockaddr_un name; > struct sockaddr_un name_ac; > fd_set readfds; > int maxfds; > socklen_t len; > char buf[READSIZE + 1]; > > unlink(SOCKFILE); > rc = socket(AF_UNIX, SOCK_STREAM, 5); > if (rc == -1){ > printf("socket error (%d)\n", errno); > return(errno); > } > else { > fds = rc; > } > > name.sun_family = AF_UNIX; > strcpy(name.sun_path, SOCKFILE); > rc = bind(fds, (struct sockaddr *)&name, sizeof(name)); > if (rc == -1){ > printf("bind error (%d)\n", errno); > return(errno); > } > else; > > rc = listen(fds, 5); > if (rc == -1){ > printf("listen error (%d)\n", errno); > return(errno); > } > else; > > FD_ZERO(&readfds); > FD_SET(fds, &readfds); > maxfds = fds + 1; > > while(1){ > rc = select(maxfds, &readfds, NULL, NULL, NULL); > if (rc == -1){ > printf("select error (%d)\n", errno); > return(errno); > } > else; > > if (!FD_ISSET(fds, &readfds)){ > printf("select2 error (%d)\n", errno); > return(errno); > } > else; > > rc = accept(fds, (struct sockaddr *)&name_ac, &len); > if (rc == -1){ > printf("accept error (%d)\n", errno); > return(errno); > } > else; > > newfds = rc; > > bzero(buf, READSIZE + 1); > rc = read(newfds, buf, READSIZE); > if (rc == -1){ > printf("read error (%d)\n", errno); > close(newfds); > return(errno); > } > else if (rc == 0){ > printf("read zero !!\n"); > rc = read(newfds, buf, READSIZE); > printf("==> retry! rc=%d, buf=%s\n", rc, buf); > close(newfds); > } > else if (rc == READSIZE){ > close(newfds); > } > else { > printf("read %d bytes\n", rc); > close(newfds); > return(-1); > } > } > 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 444560
: 304061 |
304062