Univention Bugzilla – Attachment 3270 Details for
Bug 22517
Potentielles blockieren durch zu große Ausgabe von UCS Script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Detect pipe size
22517_pipe_size.c (text/plain), 695 bytes, created by
Philipp Hahn
on 2011-05-13 14:10:56 CEST
(
hide
)
Description:
Detect pipe size
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2011-05-13 14:10:56 CEST
Size:
695 bytes
patch
obsolete
>/* Bug #22517 */ >#define _GNU_SOURCE >#include <stdlib.h> >#include <stdio.h> >#include <unistd.h> >#include <errno.h> >#include <error.h> >#include <fcntl.h> > >int main(void) { > union { > int pipefd[2]; > struct { > int readfd; > int writefd; > }; > } p; > int r; > int i; > r = pipe2(p.pipefd, O_NONBLOCK); > if (r) { > error(r, errno, "Failed to create pipe()\n"); > return EXIT_FAILURE; > } > for (i = 0;; i++) { > do { > r = write(p.writefd, " ", 1); > } while (r == -1 && errno == EINTR); /* interrupted by signal */ > if (r == -1 && errno == EWOULDBLOCK) { > printf("%d\n", i); > return EXIT_SUCCESS; > } > if (r != 1) { > error(r, errno, "Failed to write()\n"); > return EXIT_FAILURE; > } > } >}
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 22517
:
3269
| 3270