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 154267 Details for
Bug 234426
LSPP: Interrupted syscalls do not have the correct errno value in the audit log
[?]
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.
Simple test case
do_accept.c (text/x-csrc), 2.27 KB, created by
Paul Moore
on 2007-05-07 14:31:25 UTC
(
hide
)
Description:
Simple test case
Filename:
MIME Type:
Creator:
Paul Moore
Created:
2007-05-07 14:31:25 UTC
Size:
2.27 KB
patch
obsolete
>/* (c) Copyright Hewlett-Packard Development Company, L.P., 2007 > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > * the Free Software Foundation; either version 2 of the License, or > * (at your option) any later version. > * > * This program is distributed in the hope that it will be useful, > * but WITHOUT ANY WARRANTY; without even the implied warranty of > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See > * the GNU General Public License for more details. > * > * You should have received a copy of the GNU General Public License > * along with this program; if not, write to the Free Software > * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > */ > >#include <errno.h> >#include <unistd.h> >#include <limits.h> >#include <sys/socket.h> >#include <netdb.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <signal.h> > >#define ALARM_TIMER 15 > >void sig_handler(int sig_num) >{ > return; >} > >int main(int argc, char **argv) >{ > int rc, result; > struct sockaddr_storage sock_addr; > struct sockaddr_in *sock_addr4 = (struct sockaddr_in *)&sock_addr; > struct sockaddr_in6 *sock_addr6 = (struct sockaddr_in6 *)&sock_addr; > int sock; > int bool_true = 1; > > if (argc != 3) { > fprintf(stderr, "Usage:\n%s ipv4|ipv6 <port>\n", argv[0]); > return 1; > } > > signal(SIGALRM, sig_handler); > siginterrupt(SIGALRM, 1); > alarm(ALARM_TIMER); > > memset(&sock_addr, 0, sizeof(sock_addr)); > if (strcasecmp(argv[1], "ipv4") == 0) { > sock_addr.ss_family = AF_INET; > sock_addr4->sin_port = htons(atoi(argv[2])); > } else if (strcasecmp(argv[1], "ipv6") == 0) { > sock_addr.ss_family = AF_INET6; > sock_addr6->sin6_port = htons(atoi(argv[2])); > } else > return 1; > sock = socket(sock_addr.ss_family, SOCK_STREAM, IPPROTO_TCP); > if (sock < 0) > return 1; > rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &bool_true, sizeof(int)); > if (rc < 0) > return 1; > rc = bind(sock, (struct sockaddr *)&sock_addr, sizeof(sock_addr)); > if (rc < 0) > return 1; > rc = listen(sock, 1); > if (rc < 0) > return 1; > > errno = 0; > rc = accept(sock, NULL, 0); > result = (rc < 0 ? 2 : 0); > > printf("%d %d %d\n", result, result ? errno : rc, getpid()); > return result; >}
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 234426
: 154267