Bug 59401 - <pthread.h> cannot declare pthread_rwlock_t
<pthread.h> cannot declare pthread_rwlock_t
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-02-06 21:11 EST by Eric Fallon
Modified: 2007-04-18 12:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-02-06 21:13:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Very short program used to produce error. (838 bytes, text/plain)
2002-02-06 21:13 EST, Eric Fallon
no flags Details

  None (edit)
Description Eric Fallon 2002-02-06 21:11:08 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
When attempting to compile a program declaring pthread_rwlock_t from <pthread.h>
gcc will issue an error and fail.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Obtain the program simple.c
2.  Invoke gcc -c simple.c

Actual Results:  Upon compilation gcc will issue the following error messages:

simple.c:16: parse error before 'rwlock'
simple.c:16: warning: data definition has no type or storage class

Expected Results:  gcc should allow you to declare this type.

Without being able to declare this type you will not be able to utalize any of
the rwlock methods included in <pthread.h> as they all utalize a variable of
type pthread_rwlock_t.

Additional info:

I am using glibc version 2.2.4-19.3.

This program will compile without error on Solaris.
Comment 1 Eric Fallon 2002-02-06 21:13:40 EST
Created attachment 44798 [details]
Very short program used to produce error.
Comment 2 Jakub Jelinek 2002-02-07 05:19:29 EST
pthread_rwlock_t is only available in Unix98 and later standards.
So, you need to choose such feature set if you want to use it.
One of -D_XOPEN_SOURCE=500, -D_XOPEN_SOURCE=600 or -D_GNU_SOURCE will do.
See info libc on "Feature Test Macros".

Note You need to log in before you can comment on or make changes to this bug.