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 297069 Details for
Bug 435337
pthread_attr_setstacksize is incorrect on PPC and S390
[?]
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.
Oddity
sticky-stacker.c (text/plain), 1.47 KB, created by
Gary Benson
on 2008-03-06 16:32:00 UTC
(
hide
)
Description:
Oddity
Filename:
MIME Type:
Creator:
Gary Benson
Created:
2008-03-06 16:32:00 UTC
Size:
1.47 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <pthread.h> >#include <signal.h> >#include <unistd.h> > >void fatal1(char *fmt, int res) >{ > fprintf(stderr, fmt, res); > fprintf(stderr, "\n"); > exit(1); >} > >void *threadmain(void *arg) >{ > size_t requested = (size_t) arg; > pthread_attr_t attr; > void *stack_bottom; > size_t stack_size; > int res; > > res = pthread_getattr_np(pthread_self(), &attr); > if (res != 0) { > fatal1("pthread_getattr_np failed with errno = %d", res); > } > > res = pthread_attr_getstack(&attr, &stack_bottom, &stack_size); > if (res != 0) { > fatal1("pthread_attr_getstack failed with errno = %d", res); > } > > printf("Requested %d, got %d\n", requested, stack_size); > return NULL; >} > >void test(size_t stacksize) >{ > pthread_attr_t attr; > pthread_t tid; > int res, arg; > > res = pthread_attr_init(&attr); > if (res != 0) { > fatal1("pthread_attr_init failed with errno = %d", res); > } > > res = pthread_attr_setstacksize(&attr, stacksize); > if (res != 0) { > fatal1("pthread_attr_setstacksize failed with errno = %d", res); > } > > res = pthread_create(&tid, &attr, threadmain, (void *) stacksize); > if (res != 0) { > fatal1("pthread_create failed with errno = %d", res); > } > > res = pthread_join(tid, NULL); > if (res != 0) { > fatal1("pthread_join failed with errno = %d", res); > } > > pthread_attr_destroy(&attr); >} > >int main(int argc, char *argv[]) >{ > size_t page_size = sysconf(_SC_PAGESIZE); > int i; > > for (i = -3; i < 4; i++) > test((128 + i) * page_size); >}
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 435337
: 297069