Remove stray white spaces.

This commit is contained in:
Ralf Corsepius
2004-04-16 09:24:30 +00:00
parent 048dcd2b3a
commit 1b4f2b305c
232 changed files with 892 additions and 892 deletions

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -34,12 +34,12 @@ class rtemsEvent
{ {
public: public:
// attribute a task can have // attribute a task can have
enum WaitMode { wait = RTEMS_WAIT, enum WaitMode { wait = RTEMS_WAIT,
no_wait = RTEMS_NO_WAIT}; no_wait = RTEMS_NO_WAIT};
enum Condition { any = RTEMS_EVENT_ANY, enum Condition { any = RTEMS_EVENT_ANY,
all = RTEMS_EVENT_ALL}; all = RTEMS_EVENT_ALL};
// only the first 4 characters of the name are taken // only the first 4 characters of the name are taken
// connect to a task // connect to a task
@@ -48,14 +48,14 @@ public:
// copy and default constructors // copy and default constructors
rtemsEvent(const rtemsEvent& event); rtemsEvent(const rtemsEvent& event);
rtemsEvent(); rtemsEvent();
virtual ~rtemsEvent(); virtual ~rtemsEvent();
// connect to an existing task object, will not be the owner // connect to an existing task object, will not be the owner
const rtemsEvent& operator=(const rtemsEvent& event); const rtemsEvent& operator=(const rtemsEvent& event);
virtual const rtems_status_code connect(const char *name, virtual const rtems_status_code connect(const char *name,
const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES); const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
// send an event // send an event
inline const rtems_status_code send(const rtems_id task, inline const rtems_status_code send(const rtems_id task,
const rtems_event_set events); const rtems_event_set events);
@@ -73,7 +73,7 @@ public:
// object id, and name // object id, and name
const rtems_id task_id_is() const { return id; } const rtems_id task_id_is() const { return id; }
const rtems_name task_name_is() const { return name; } const rtems_name task_name_is() const { return name; }
private: private:
// task name // task name
rtems_name name; rtems_name name;

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -29,11 +29,11 @@
the old handler is not an instance of this class the chain is passed the old handler is not an instance of this class the chain is passed
as "void (*)(void)". If it is an instance of this class, the handler as "void (*)(void)". If it is an instance of this class, the handler
method is directly called. method is directly called.
The isr catch extends the documented return codes with : The isr catch extends the documented return codes with :
RTEMS_RESOURCE_IN_USE = interrupt already caught RTEMS_RESOURCE_IN_USE = interrupt already caught
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#if !defined(_rtemsInterrupt_h_) #if !defined(_rtemsInterrupt_h_)
@@ -54,13 +54,13 @@ public:
// catch the interrupt // catch the interrupt
virtual const rtems_status_code isr_catch(const rtems_vector_number vector); virtual const rtems_status_code isr_catch(const rtems_vector_number vector);
// release the interrupt back to the previous handle // release the interrupt back to the previous handle
virtual const rtems_status_code release(); virtual const rtems_status_code release();
// the old handler // the old handler
const rtems_isr_entry old_isr_handler() const { return old_handler; } const rtems_isr_entry old_isr_handler() const { return old_handler; }
protected: protected:
// called after the interrupt is caught and it goes off // called after the interrupt is caught and it goes off
@@ -68,17 +68,17 @@ protected:
// chain to the previous handler, // chain to the previous handler,
inline void chain() const; inline void chain() const;
private: private:
const rtemsInterrupt& operator=(const rtemsInterrupt& ); const rtemsInterrupt& operator=(const rtemsInterrupt& );
rtemsInterrupt(const rtemsInterrupt& ); rtemsInterrupt(const rtemsInterrupt& );
// the vector caught // the vector caught
rtems_vector_number vector; rtems_vector_number vector;
// true when the interrupt is caught // true when the interrupt is caught
bool caught; bool caught;
// returned when catching the interrupt // returned when catching the interrupt
rtems_isr_entry old_handler; rtems_isr_entry old_handler;

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -33,7 +33,7 @@
The fourth constructor allows for the message queue to be created The fourth constructor allows for the message queue to be created
after construction, or to connect to a message queue later. after construction, or to connect to a message queue later.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#if !defined(_rtemsMessageQueue_h_) #if !defined(_rtemsMessageQueue_h_)
@@ -54,7 +54,7 @@ public:
wait_by_priority = RTEMS_PRIORITY }; wait_by_priority = RTEMS_PRIORITY };
enum Scope { local = RTEMS_LOCAL, enum Scope { local = RTEMS_LOCAL,
global = RTEMS_GLOBAL }; global = RTEMS_GLOBAL };
// only the first 4 characters of the name are taken // only the first 4 characters of the name are taken
// creates a message queue // creates a message queue
@@ -70,10 +70,10 @@ public:
// copy and default constructors // copy and default constructors
rtemsMessageQueue(const rtemsMessageQueue& message_queue); rtemsMessageQueue(const rtemsMessageQueue& message_queue);
rtemsMessageQueue(); rtemsMessageQueue();
// only the creator's destructor will delete the actual object // only the creator's destructor will delete the actual object
virtual ~rtemsMessageQueue(); virtual ~rtemsMessageQueue();
// create or destroy (delete) the message queue // create or destroy (delete) the message queue
virtual const rtems_status_code create(const char* name, virtual const rtems_status_code create(const char* name,
const rtems_unsigned32 count, const rtems_unsigned32 count,
@@ -86,7 +86,7 @@ public:
const rtemsMessageQueue& operator=(const rtemsMessageQueue& message_queue); const rtemsMessageQueue& operator=(const rtemsMessageQueue& message_queue);
virtual const rtems_status_code connect(const char *name, virtual const rtems_status_code connect(const char *name,
const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES); const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
// send a message of size from the buffer // send a message of size from the buffer
inline const rtems_status_code send(const void *buffer, inline const rtems_status_code send(const void *buffer,
const rtems_unsigned32 size); const rtems_unsigned32 size);
@@ -101,28 +101,28 @@ public:
rtems_unsigned32& size, rtems_unsigned32& size,
rtems_interval micro_secs = RTEMS_NO_TIMEOUT, rtems_interval micro_secs = RTEMS_NO_TIMEOUT,
bool wait = true); bool wait = true);
// flush a message queue, returning the number of messages dropped // flush a message queue, returning the number of messages dropped
inline const rtems_status_code flush(rtems_unsigned32& size); inline const rtems_status_code flush(rtems_unsigned32& size);
// object id, and name // object id, and name
const rtems_id id_is() const { return id; } const rtems_id id_is() const { return id; }
const rtems_name name_is() const { return name; } const rtems_name name_is() const { return name; }
const char *name_string() const { return name_str; } const char *name_string() const { return name_str; }
private: private:
// make this object reference an invalid RTEMS object // make this object reference an invalid RTEMS object
void make_invalid(); void make_invalid();
// message queue name // message queue name
rtems_name name; rtems_name name;
char name_str[5]; char name_str[5];
// owner, true if this object owns the message queue // owner, true if this object owns the message queue
// will delete the message queue when it destructs // will delete the message queue when it destructs
bool owner; bool owner;
// the rtems id, object handle // the rtems id, object handle
rtems_id id; rtems_id id;
}; };

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -73,7 +73,7 @@ public:
// connect to an existing semaphore object by name // connect to an existing semaphore object by name
rtemsSemaphore(const char *name, const rtems_unsigned32 node); rtemsSemaphore(const char *name, const rtems_unsigned32 node);
// attach this object to an other objects semaphore // attach this object to an other objects semaphore
rtemsSemaphore(const rtemsSemaphore& semaphore); rtemsSemaphore(const rtemsSemaphore& semaphore);
rtemsSemaphore(); rtemsSemaphore();
@@ -91,28 +91,28 @@ public:
const Ceiling ceiling = no_priority_ceiling, const Ceiling ceiling = no_priority_ceiling,
const rtems_task_priority priority_ceiling = 0); const rtems_task_priority priority_ceiling = 0);
virtual const rtems_status_code destroy(); virtual const rtems_status_code destroy();
// connect to an existing semaphore object, will not be the owner // connect to an existing semaphore object, will not be the owner
const rtemsSemaphore& operator=(const rtemsSemaphore& semaphore); const rtemsSemaphore& operator=(const rtemsSemaphore& semaphore);
virtual const rtems_status_code connect(const char *name, rtems_unsigned32 node); virtual const rtems_status_code connect(const char *name, rtems_unsigned32 node);
// obtain the semaphore, timeout is in micro-seconds // obtain the semaphore, timeout is in micro-seconds
inline const rtems_status_code obtain(bool wait = true, inline const rtems_status_code obtain(bool wait = true,
const rtems_unsigned32 micro_secs = RTEMS_NO_TIMEOUT); const rtems_unsigned32 micro_secs = RTEMS_NO_TIMEOUT);
// release the semaphore, blocks threads eligble // release the semaphore, blocks threads eligble
inline const rtems_status_code release(); inline const rtems_status_code release();
// object id, and name // object id, and name
const rtems_id id_is() const { return id; } const rtems_id id_is() const { return id; }
const rtems_name name_is() const { return name; } const rtems_name name_is() const { return name; }
const char *name_string() const { return name_str; } const char *name_string() const { return name_str; }
private: private:
// make the object reference no valid RTEMS object // make the object reference no valid RTEMS object
void make_invalid(); void make_invalid();
// semaphore name // semaphore name
rtems_name name; rtems_name name;
char name_str[5]; char name_str[5];
@@ -120,7 +120,7 @@ private:
// owner, true if this object owns the semaphore // owner, true if this object owns the semaphore
// will delete the semaphore when it destructs // will delete the semaphore when it destructs
bool owner; bool owner;
// the rtems id, object handle // the rtems id, object handle
rtems_id id; rtems_id id;
}; };

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -14,7 +14,7 @@
------------------------------------------------------------------------ ------------------------------------------------------------------------
rtemsStatusCode controls and manages status codes from the RTEMS kernel. rtemsStatusCode controls and manages status codes from the RTEMS kernel.
------------------------------------------------------------------------ ------------------------------------------------------------------------
*/ */
@@ -30,15 +30,15 @@
class rtemsStatusCode class rtemsStatusCode
{ {
public: public:
rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; } rtemsStatusCode() { last_status = RTEMS_NOT_CONFIGURED; }
const bool successful() { return last_status == RTEMS_SUCCESSFUL; } const bool successful() { return last_status == RTEMS_SUCCESSFUL; }
const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; } const bool unsuccessful() { return last_status != RTEMS_SUCCESSFUL; }
// return the last status code // return the last status code
const rtems_status_code last_status_code() { return last_status; } const rtems_status_code last_status_code() { return last_status; }
// return the last status as a string // return the last status as a string
const char *last_status_string(); const char *last_status_string();
@@ -47,9 +47,9 @@ public:
protected: protected:
const rtems_status_code set_status_code(const rtems_status_code status) const rtems_status_code set_status_code(const rtems_status_code status)
{ return (last_status = status); } { return (last_status = status); }
private: private:
// public at the moment, this might change // public at the moment, this might change
rtems_status_code last_status; rtems_status_code last_status;
}; };

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -29,7 +29,7 @@
The third constructor is a copy constructor. Connects to an existing The third constructor is a copy constructor. Connects to an existing
object which is in scope. object which is in scope.
The RTEMS id is set to self in the default construction. The RTEMS id is set to self in the default construction.
The creation of the task object can be defered until after The creation of the task object can be defered until after
@@ -50,7 +50,7 @@
Mode control is through the rtemsTaskMode class. Mode control is through the rtemsTaskMode class.
The rtemsTask class reserved notepad register 31. The rtemsTask class reserved notepad register 31.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#if !defined(_rtemsTask_h_) #if !defined(_rtemsTask_h_)
@@ -90,10 +90,10 @@ public:
// copy and default constructors // copy and default constructors
rtemsTask(const rtemsTask& task); rtemsTask(const rtemsTask& task);
rtemsTask(); rtemsTask();
// only the creator's destructor will delete the actual object // only the creator's destructor will delete the actual object
virtual ~rtemsTask(); virtual ~rtemsTask();
// create or destroy (delete) the task // create or destroy (delete) the task
virtual const rtems_status_code create(const char* name, virtual const rtems_status_code create(const char* name,
const rtems_task_priority initial_priority, const rtems_task_priority initial_priority,
@@ -110,7 +110,7 @@ public:
const rtemsTask& operator=(const rtemsTask& task); const rtemsTask& operator=(const rtemsTask& task);
virtual const rtems_status_code connect(const char *name, virtual const rtems_status_code connect(const char *name,
const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES); const rtems_unsigned32 node = RTEMS_SEARCH_ALL_NODES);
// run control // run control
virtual const rtems_status_code start(const rtems_task_argument argument); virtual const rtems_status_code start(const rtems_task_argument argument);
virtual const rtems_status_code restart(const rtems_task_argument argument); virtual const rtems_status_code restart(const rtems_task_argument argument);
@@ -120,13 +120,13 @@ public:
// sleep control, the timeout is in micro-seconds // sleep control, the timeout is in micro-seconds
virtual const rtems_status_code wake_after(const rtems_interval micro_secs); virtual const rtems_status_code wake_after(const rtems_interval micro_secs);
virtual const rtems_status_code wake_when(const rtems_time_of_day& tod); virtual const rtems_status_code wake_when(const rtems_time_of_day& tod);
// priority control // priority control
const rtems_status_code get_priority(rtems_task_priority& priority); const rtems_status_code get_priority(rtems_task_priority& priority);
const rtems_status_code set_priority(const rtems_task_priority priority); const rtems_status_code set_priority(const rtems_task_priority priority);
const rtems_status_code set_priority(const rtems_task_priority priority, const rtems_status_code set_priority(const rtems_task_priority priority,
rtems_task_priority& old_priority); rtems_task_priority& old_priority);
// notepad control // notepad control
const rtems_status_code get_note(const rtems_unsigned32 notepad, const rtems_status_code get_note(const rtems_unsigned32 notepad,
rtems_unsigned32& note); rtems_unsigned32& note);
@@ -137,17 +137,17 @@ public:
const rtems_id id_is() const { return id; } const rtems_id id_is() const { return id; }
const rtems_name name_is() const { return name; } const rtems_name name_is() const { return name; }
const char *name_string() const { return name_str; } const char *name_string() const { return name_str; }
protected: protected:
// task entry point // task entry point
virtual void body(rtems_task_argument argument); virtual void body(rtems_task_argument argument);
private: private:
// make the object to point to RTEMS_SELF // make the object to point to RTEMS_SELF
void make_self(); void make_self();
// task name // task name
rtems_name name; rtems_name name;
char name_str[5]; char name_str[5];
@@ -155,14 +155,14 @@ private:
// owner, true if this object owns the task // owner, true if this object owns the task
// will delete the task when it destructs // will delete the task when it destructs
bool owner; bool owner;
// the rtems id, object handle // the rtems id, object handle
rtems_id id; rtems_id id;
// the argument for the task, this class uses the actual argument // the argument for the task, this class uses the actual argument
// passed to RTEMS // passed to RTEMS
rtems_task_argument argument; rtems_task_argument argument;
// common entry point to the task // common entry point to the task
static rtems_task origin(rtems_task_argument argument); static rtems_task origin(rtems_task_argument argument);
}; };

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -29,7 +29,7 @@
Methods are provided for accessing and controlling a specific Methods are provided for accessing and controlling a specific
mode. The returned value will only contain the requested mode's flags, mode. The returned value will only contain the requested mode's flags,
and only the that mode will be changed when setting a mode. and only the that mode will be changed when setting a mode.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#if !defined(_rtemsTaskMode_h_) #if !defined(_rtemsTaskMode_h_)
@@ -45,9 +45,9 @@ class rtemsTaskMode
: public rtemsStatusCode : public rtemsStatusCode
{ {
public: public:
rtemsTaskMode() {}; rtemsTaskMode() {};
// group mode control, OR the values together // group mode control, OR the values together
inline const rtems_status_code get_mode(rtems_mode& mode); inline const rtems_status_code get_mode(rtems_mode& mode);
inline const rtems_status_code set_mode(const rtems_mode mode, inline const rtems_status_code set_mode(const rtems_mode mode,
@@ -55,7 +55,7 @@ public:
inline const rtems_status_code set_mode(const rtems_mode mode, inline const rtems_status_code set_mode(const rtems_mode mode,
const rtems_mode mask, const rtems_mode mask,
rtems_mode& old_mode); rtems_mode& old_mode);
// preemption control // preemption control
inline const rtems_status_code get_preemption_state(rtems_mode& preemption); inline const rtems_status_code get_preemption_state(rtems_mode& preemption);
inline const rtems_status_code set_preemption_state(const rtems_mode preemption); inline const rtems_status_code set_preemption_state(const rtems_mode preemption);

View File

@@ -6,7 +6,7 @@
COPYRIGHT (c) 1997 COPYRIGHT (c) 1997
Objective Design Systems Ltd Pty (ODS) Objective Design Systems Ltd Pty (ODS)
All rights reserved (R) Objective Design Systems Ltd Pty All rights reserved (R) Objective Design Systems Ltd Pty
The license and distribution terms for this file may be found in the The license and distribution terms for this file may be found in the
file LICENSE in this distribution or at file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
@@ -22,7 +22,7 @@
method. method.
Timers are always local to a node. Timers are always local to a node.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#if !defined(_rtemsTimer_h_) #if !defined(_rtemsTimer_h_)
@@ -43,32 +43,32 @@ public:
// create a timer object // create a timer object
rtemsTimer(const char* name); rtemsTimer(const char* name);
rtemsTimer(); rtemsTimer();
// destroies the actual object // destroies the actual object
virtual ~rtemsTimer(); virtual ~rtemsTimer();
// create or destroy (delete) the timer // create or destroy (delete) the timer
virtual const rtems_status_code create(const char* name); virtual const rtems_status_code create(const char* name);
virtual const rtems_status_code destroy(); virtual const rtems_status_code destroy();
// timer control // timer control
inline const rtems_status_code fire_after(const rtems_interval micro_secs); inline const rtems_status_code fire_after(const rtems_interval micro_secs);
inline const rtems_status_code repeat_fire_at(const rtems_interval micro_secs); inline const rtems_status_code repeat_fire_at(const rtems_interval micro_secs);
inline const rtems_status_code fire_when(const rtems_time_of_day& when); inline const rtems_status_code fire_when(const rtems_time_of_day& when);
inline const rtems_status_code cancel(); inline const rtems_status_code cancel();
inline const rtems_status_code reset(); inline const rtems_status_code reset();
// object id, and name // object id, and name
const rtems_id id_is() const { return id; } const rtems_id id_is() const { return id; }
const rtems_name name_is() const { return name; } const rtems_name name_is() const { return name; }
const char *name_string() const { return name_str; } const char *name_string() const { return name_str; }
protected: protected:
// triggered method is called when the timer fires // triggered method is called when the timer fires
virtual void triggered() = 0; virtual void triggered() = 0;
private: private:
// not permitted // not permitted
rtemsTimer(const rtemsTimer& timer); rtemsTimer(const rtemsTimer& timer);
@@ -76,7 +76,7 @@ private:
// make this object reference an invalid RTEMS object // make this object reference an invalid RTEMS object
void make_invalid(); void make_invalid();
// semaphore name // semaphore name
rtems_name name; rtems_name name;
char name_str[5]; char name_str[5];

View File

@@ -69,7 +69,7 @@ void TestCre()
{ {
ER status; ER status;
T_CMBF pk_cmbf; T_CMBF pk_cmbf;
/* /*
* Exercise cre_mbf - this code seems to exercise every path. * Exercise cre_mbf - this code seems to exercise every path.
*/ */
@@ -97,7 +97,7 @@ void TestCre()
pk_cmbf.maxmsz = 101; pk_cmbf.maxmsz = 101;
status = cre_mbf( 1, &pk_cmbf ); status = cre_mbf( 1, &pk_cmbf );
assert( status == E_PAR ); assert( status == E_PAR );
/* /*
* Now run through all the bad ID errors * Now run through all the bad ID errors
*/ */
@@ -126,7 +126,7 @@ void TestCre()
pk_cmbf.mbfatr = TA_TFIFO; pk_cmbf.mbfatr = TA_TFIFO;
status = cre_mbf( 1, &pk_cmbf ); status = cre_mbf( 1, &pk_cmbf );
assert( status == E_OK ); assert( status == E_OK );
puts( "Init - cre_mbf - create mbf 1 again - E_OBJ" ); puts( "Init - cre_mbf - create mbf 1 again - E_OBJ" );
status = cre_mbf( 1, &pk_cmbf ); status = cre_mbf( 1, &pk_cmbf );
assert( status == E_OBJ ); assert( status == E_OBJ );
@@ -142,7 +142,7 @@ void TestCre()
void TestDel() void TestDel()
{ {
ER status; ER status;
/* /*
* Generate all the bad id errors for del_mbf * Generate all the bad id errors for del_mbf
*/ */
@@ -163,7 +163,7 @@ void TestDel()
status = del_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1 ); status = del_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1 );
assert( status == E_ID ); assert( status == E_ID );
puts("Init - del_mbf - E_OK" ); puts("Init - del_mbf - E_OK" );
status = del_mbf(2); status = del_mbf(2);
assert(status == E_OK); assert(status == E_OK);
@@ -173,7 +173,7 @@ void TestPsnd()
{ {
ER status; ER status;
char msg[100] = "This is test message 1"; char msg[100] = "This is test message 1";
/* /*
* Generate all the bad id errors for psnd_mbf * Generate all the bad id errors for psnd_mbf
*/ */
@@ -192,23 +192,23 @@ void TestPsnd()
puts( "Init - psnd_mbf - bad id (too great) - E_ID" ); puts( "Init - psnd_mbf - bad id (too great) - E_ID" );
status = psnd_mbf(CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, msg, status = psnd_mbf(CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, msg,
sizeof(msg)); sizeof(msg));
assert( status == E_ID ); assert( status == E_ID );
puts( "Init - psnd_mbf - msg == 0, E_PAR" ); puts( "Init - psnd_mbf - msg == 0, E_PAR" );
status = psnd_mbf(1, 0, sizeof(msg)); status = psnd_mbf(1, 0, sizeof(msg));
assert( status == E_PAR ); assert( status == E_PAR );
puts( "Init - psnd_mbf - msgsz too big - E_PAR" ); puts( "Init - psnd_mbf - msgsz too big - E_PAR" );
status = psnd_mbf(1, msg, 300); status = psnd_mbf(1, msg, 300);
assert( status == E_PAR ); assert( status == E_PAR );
puts( "Init - psnd_mbf - msgsz <0 - E_PAR" ); puts( "Init - psnd_mbf - msgsz <0 - E_PAR" );
status = psnd_mbf(1, msg, -10); status = psnd_mbf(1, msg, -10);
assert( status == E_PAR ); assert( status == E_PAR );
puts( "Init - psnd_mbf - E_OK" ); puts( "Init - psnd_mbf - E_OK" );
status = psnd_mbf(1, msg, sizeof(msg)); status = psnd_mbf(1, msg, sizeof(msg));
assert( status == E_OK ); assert( status == E_OK );
} }
@@ -216,7 +216,7 @@ void TestRef()
{ {
ER status; ER status;
T_RMBF pk_rmbf; T_RMBF pk_rmbf;
puts( "Init - ref_mbf - bad id (less than -4) - E_OACV" ); puts( "Init - ref_mbf - bad id (less than -4) - E_OACV" );
status = ref_mbf(&pk_rmbf, -5); status = ref_mbf(&pk_rmbf, -5);
assert( status == E_OACV ); assert( status == E_OACV );
@@ -241,7 +241,7 @@ void TestRef()
puts( "Init - ref_mbf - mbf 1 - E_OK" ); puts( "Init - ref_mbf - mbf 1 - E_OK" );
status = ref_mbf( &pk_rmbf, 1 ); status = ref_mbf( &pk_rmbf, 1 );
assert( status == E_OK ); assert( status == E_OK );
printf( "Init - mbf 1 msgsz = %d\n", pk_rmbf.msgsz ); printf( "Init - mbf 1 msgsz = %d\n", pk_rmbf.msgsz );
printf( "Init - mbf 1 frbufsz = %d\n", pk_rmbf.frbufsz ); printf( "Init - mbf 1 frbufsz = %d\n", pk_rmbf.frbufsz );
printf( "Init - mbf 1 waiting tasks = %d\n", pk_rmbf.wtsk ); printf( "Init - mbf 1 waiting tasks = %d\n", pk_rmbf.wtsk );
@@ -342,7 +342,7 @@ void TestTrcv()
puts( "Init - trcv_mbf - bad id (too great) - E_ID" ); puts( "Init - trcv_mbf - bad id (too great) - E_ID" );
status = trcv_mbf(buffer, &s, status = trcv_mbf(buffer, &s,
CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1,
5000); 5000);
assert( status == E_ID ); assert( status == E_ID );
puts( "Init - trcv_mbf - NULL msg returns E_PAR" ); puts( "Init - trcv_mbf - NULL msg returns E_PAR" );

View File

@@ -152,8 +152,8 @@ void ITRON_Init( void )
puts( "Init - preq_sem - bad id (less than -4) - E_OACV" ); puts( "Init - preq_sem - bad id (less than -4) - E_OACV" );
status = preq_sem( -5 ); status = preq_sem( -5 );
assert( status == E_OACV ); assert( status == E_OACV );
puts( "Init - preq_sem - bad id (between 0 and -4) - E_ID" ); puts( "Init - preq_sem - bad id (between 0 and -4) - E_ID" );
status = preq_sem( -4 ); status = preq_sem( -4 );
assert( status == E_ID ); assert( status == E_ID );
@@ -256,7 +256,7 @@ void ITRON_Init( void )
assert( status == E_TMOUT ); assert( status == E_TMOUT );
/* /*
* Exercise twai_sem * Exercise twai_sem
*/ */
puts( "Init - twai_sem - semaphore 1 unavailable - 1 second E_TMOUT" ); puts( "Init - twai_sem - semaphore 1 unavailable - 1 second E_TMOUT" );

View File

@@ -42,10 +42,10 @@ void ITRON_Init( void )
pk_ctsk.exinf = NULL; pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG; pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.itskpri = 1; pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_2_through_4; pk_ctsk.task = Task_2_through_4;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2;
status = cre_tsk( 2, &pk_ctsk ); status = cre_tsk( 2, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1" ); directive_failed( status, "cre_tsk of TA1" );
@@ -53,7 +53,7 @@ void ITRON_Init( void )
status = cre_tsk( 3, &pk_ctsk ); status = cre_tsk( 3, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" ); directive_failed( status, "cre_tsk of TA2" );
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3;
status = cre_tsk( 4, &pk_ctsk ); status = cre_tsk( 4, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" ); directive_failed( status, "cre_tsk of TA3" );

View File

@@ -32,7 +32,7 @@ void Task_2_through_4()
directive_failed( status, "get_tid"); directive_failed( status, "get_tid");
tid_index = tid - 1; /* account for init tasks */ tid_index = tid - 1; /* account for init tasks */
sprintf(name, "TA%d", tid_index); sprintf(name, "TA%d", tid_index);
while( FOREVER ) { while( FOREVER ) {

View File

@@ -32,48 +32,48 @@ void ITRON_Init( void )
* Status Codes for these errors * Status Codes for these errors
* *
* *
* E_OK - Normal Completion * E_OK - Normal Completion
* *
* E_NOMEM - Insufficient memory (Memory for control block and/or user * E_NOMEM - Insufficient memory (Memory for control block and/or user
* stack cannot be allocated) * stack cannot be allocated)
* *
* E_ID - Invalid ID Number (tskid was invalid or could not be used) * E_ID - Invalid ID Number (tskid was invalid or could not be used)
* *
* E_RSATR - Reserved attribute (tskatr was invalid or could not be used) * E_RSATR - Reserved attribute (tskatr was invalid or could not be used)
* *
* E_OBJ - Invalid object state (a task of the same ID already exists) * E_OBJ - Invalid object state (a task of the same ID already exists)
* *
* E_OACV - Object access violation (A tskid less than -4 was specified * E_OACV - Object access violation (A tskid less than -4 was specified
* from a user task. This is implementation dependent.) * from a user task. This is implementation dependent.)
* *
* E_PAR - Parameter error (pk_ctsk, task, itskpri and/or stksz is invalid) * E_PAR - Parameter error (pk_ctsk, task, itskpri and/or stksz is invalid)
* *
* E_NOEXS - Object does not exist (the task specified by tskid does not * E_NOEXS - Object does not exist (the task specified by tskid does not
* exist) * exist)
* *
* E_CTX - Context error (issued from task-independent portions or a task * E_CTX - Context error (issued from task-independent portions or a task
* in dispatch disabled state) * in dispatch disabled state)
* *
* *
* *
* Network Specific Errors (ITRON calls these Connection Function Errors) * Network Specific Errors (ITRON calls these Connection Function Errors)
* *
* EN_OBJNO - An object number which could not be accessed on the target * EN_OBJNO - An object number which could not be accessed on the target
* node is specified. * node is specified.
* *
* EN_CTXID - Specified an object on another node when the system call * EN_CTXID - Specified an object on another node when the system call
* was issued from a task in dispatch disabled state or from * was issued from a task in dispatch disabled state or from
* a task-independent portion * a task-independent portion
* *
* EN_PAR - A value outside the range supported by the target node and/or * EN_PAR - A value outside the range supported by the target node and/or
* transmission packet format was specified as a parameter * transmission packet format was specified as a parameter
* (a value outside supported range was specified for exinf, * (a value outside supported range was specified for exinf,
* tskatr, task, itskpri and/or stksz) * tskatr, task, itskpri and/or stksz)
* *
* EN_RPAR - A value outside the range supported by the requesting node * EN_RPAR - A value outside the range supported by the requesting node
* and/or transmission packet format was returned as a return * and/or transmission packet format was returned as a return
* parameter (a value outside supported range was returned for * parameter (a value outside supported range was returned for
* exinf, tskpri and/or tskstat) * exinf, tskpri and/or tskstat)
* *
*/ */
@@ -81,7 +81,7 @@ void ITRON_Init( void )
rtems_time_of_day time; rtems_time_of_day time;
ER status; ER status;
T_CTSK pk_ctsk; T_CTSK pk_ctsk;
T_RTSK pk_rtsk; /* Reference Task Packet */ T_RTSK pk_rtsk; /* Reference Task Packet */
puts( "\n\n*** ITRON TASK TEST 2 ***\n" ); puts( "\n\n*** ITRON TASK TEST 2 ***\n" );
@@ -95,13 +95,13 @@ void ITRON_Init( void )
* Set My priority to 8 so that dummy tasks will be * Set My priority to 8 so that dummy tasks will be
* forced to run when started. * forced to run when started.
*/ */
status = chg_pri( TSK_SELF, 8 ); status = chg_pri( TSK_SELF, 8 );
fatal_directive_status( status, E_OK, "chg_pri of TSK_SELF"); fatal_directive_status( status, E_OK, "chg_pri of TSK_SELF");
status = ref_tsk( &pk_rtsk, TSK_SELF ); status = ref_tsk( &pk_rtsk, TSK_SELF );
fatal_directive_status( status, E_OK, "ref_tsk of TSK_SELF"); fatal_directive_status( status, E_OK, "ref_tsk of TSK_SELF");
fatal_directive_status( pk_rtsk.tskpri, 8, "task priority of SELF"); fatal_directive_status( pk_rtsk.tskpri, 8, "task priority of SELF");
/* /*
* Create and verify a DORMANT task. * Create and verify a DORMANT task.
*/ */
@@ -110,7 +110,7 @@ void ITRON_Init( void )
pk_ctsk.tskatr = TA_HLNG; pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.itskpri = 1; pk_ctsk.itskpri = 1;
pk_ctsk.task = Dormant_task; pk_ctsk.task = Dormant_task;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
puts( "Init - cre_tsk - Dormant Task" ); puts( "Init - cre_tsk - Dormant Task" );
status = cre_tsk( DORMANT_TASK_ID, &pk_ctsk ); status = cre_tsk( DORMANT_TASK_ID, &pk_ctsk );
@@ -122,7 +122,7 @@ void ITRON_Init( void )
/* /*
* Create, Start and verify a not DORMANT task. * Create, Start and verify a not DORMANT task.
*/ */
pk_ctsk.task = Non_Dormant_task; pk_ctsk.task = Non_Dormant_task;
puts( "Init - cre_tsk - Non-Dormant Task" ); puts( "Init - cre_tsk - Non-Dormant Task" );
status = cre_tsk( NON_DORMANT_TASK_ID, &pk_ctsk ); status = cre_tsk( NON_DORMANT_TASK_ID, &pk_ctsk );
@@ -131,8 +131,8 @@ void ITRON_Init( void )
status = ref_tsk( &pk_rtsk, NON_DORMANT_TASK_ID ); status = ref_tsk( &pk_rtsk, NON_DORMANT_TASK_ID );
fatal_directive_status( status, E_OK, "ref_tsk of NON_DORMANT"); fatal_directive_status( status, E_OK, "ref_tsk of NON_DORMANT");
fatal_directive_status( pk_rtsk.tskstat,TTS_WAI,"task state of NON_DORMANT"); fatal_directive_status( pk_rtsk.tskstat,TTS_WAI,"task state of NON_DORMANT");
/* /*
* Bad ID errors * Bad ID errors
*/ */
@@ -199,15 +199,15 @@ void ITRON_Init( void )
puts( "\n\n*** Delete Task Errors ***" ); puts( "\n\n*** Delete Task Errors ***" );
/* /*
* Reset structure * Reset structure
*/ */
pk_ctsk.exinf = NULL; pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG; pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.itskpri = 1; pk_ctsk.itskpri = 1;
pk_ctsk.task = Dormant_task; pk_ctsk.task = Dormant_task;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" );
@@ -362,7 +362,7 @@ void ITRON_Init( void )
* to handle this - addr=0x80002098 nr_bytes=0x4 processor=0x40134008 * to handle this - addr=0x80002098 nr_bytes=0x4 processor=0x40134008
* cia=0xc744" * cia=0xc744"
*/ */
puts( "\n\n*** Rotate Ready Queue Errors ***" ); puts( "\n\n*** Rotate Ready Queue Errors ***" );
puts( "Init - rot_rdq - priority -1 - E_PAR" ); puts( "Init - rot_rdq - priority -1 - E_PAR" );
status = rot_rdq( -1 ); status = rot_rdq( -1 );
@@ -407,7 +407,7 @@ void ITRON_Init( void )
status = ref_tsk( &pk_rtsk, -2 ); status = ref_tsk( &pk_rtsk, -2 );
fatal_directive_status( status, E_ID, "ref_tsk -2"); fatal_directive_status( status, E_ID, "ref_tsk -2");
/* XXX Call from task independent portion to cause E_ID /* XXX Call from task independent portion to cause E_ID
puts( "Init - ref_tsk - reference INTERRUPT - E_ID" ); puts( "Init - ref_tsk - reference INTERRUPT - E_ID" );
status = ref_tsk( &pk_rtsk, TSK_SELF ); status = ref_tsk( &pk_rtsk, TSK_SELF );
assert( status == E_ID ); assert( status == E_ID );

View File

@@ -33,8 +33,8 @@ void ITRON_Init( void )
pk_ctsk.exinf = NULL; pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG; pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
pk_ctsk.itskpri = PREEMPT_PRIORITY; pk_ctsk.itskpri = PREEMPT_PRIORITY;
pk_ctsk.task = Preempt_task; pk_ctsk.task = Preempt_task;
puts( "\n\n*** ITRON TASK TEST 3 ***" ); puts( "\n\n*** ITRON TASK TEST 3 ***" );
@@ -47,7 +47,7 @@ void ITRON_Init( void )
puts( "INIT - Create and Start PREEMPT" ); puts( "INIT - Create and Start PREEMPT" );
status = chg_pri( TSK_SELF, (PREEMPT_PRIORITY+2) ); status = chg_pri( TSK_SELF, (PREEMPT_PRIORITY+2) );
directive_failed( status, "chg_pri of SELF" ); directive_failed( status, "chg_pri of SELF" );
status = cre_tsk( PREEMPT_TASK_ID, &pk_ctsk ); status = cre_tsk( PREEMPT_TASK_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of RTEMS_PREEMPT" ); directive_failed( status, "cre_tsk of RTEMS_PREEMPT" );
@@ -61,7 +61,7 @@ void ITRON_Init( void )
status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID );
directive_failed( status, "INIT - ref_tsk of RTEMS_PREEMPT"); directive_failed( status, "INIT - ref_tsk of RTEMS_PREEMPT");
fatal_directive_status(pk_rtsk.tskstat,TTS_DMT,"tskstat of PREEMPT"); fatal_directive_status(pk_rtsk.tskstat,TTS_DMT,"tskstat of PREEMPT");
/* /*
* Restart the Preempt Task. * Restart the Preempt Task.
*/ */
@@ -76,12 +76,12 @@ void ITRON_Init( void )
fatal_directive_status( status, E_NOEXS, "tskstat of PREEMPT"); fatal_directive_status( status, E_NOEXS, "tskstat of PREEMPT");
status = chg_pri( TSK_SELF, PREEMPT_PRIORITY ); status = chg_pri( TSK_SELF, PREEMPT_PRIORITY );
directive_failed( status, "chg_pri of SELF" ); directive_failed( status, "chg_pri of SELF" );
/* /*
* XXX * XXX
*/ */
pk_ctsk.itskpri = 3; pk_ctsk.itskpri = 3;
pk_ctsk.task = Task_1; pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk ); status = cre_tsk( TA1_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1" ); directive_failed( status, "cre_tsk of TA1" );
@@ -121,7 +121,7 @@ void ITRON_Init( void )
status = ter_tsk( TA3_ID ); status = ter_tsk( TA3_ID );
directive_failed( status, "ter_tsk of TA3" ); directive_failed( status, "ter_tsk of TA3" );
pk_ctsk.itskpri = 1; pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_1; pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk ); status = cre_tsk( TA1_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA1 at priority 1" ); directive_failed( status, "cre_tsk of TA1 at priority 1" );

View File

@@ -38,7 +38,7 @@ void Preempt_task()
if ( Preempt_task_Count == 0 ) { if ( Preempt_task_Count == 0 ) {
Preempt_task_Count ++; Preempt_task_Count ++;
puts( "PREEMPT - chg_pri increment priority "); puts( "PREEMPT - chg_pri increment priority ");
status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) ); status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) );
directive_failed( status, "chg_pri" ); directive_failed( status, "chg_pri" );
puts( "PREEMPT - ext_tsk - going to DORMANT state" ); puts( "PREEMPT - ext_tsk - going to DORMANT state" );

View File

@@ -36,8 +36,8 @@ void ITRON_Init( void )
pk_ctsk.exinf = NULL; pk_ctsk.exinf = NULL;
pk_ctsk.tskatr = TA_HLNG; pk_ctsk.tskatr = TA_HLNG;
pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE;
pk_ctsk.itskpri = 2; pk_ctsk.itskpri = 2;
pk_ctsk.task = Task_1; pk_ctsk.task = Task_1;
status = cre_tsk( TA1_ID, &pk_ctsk ); status = cre_tsk( TA1_ID, &pk_ctsk );
@@ -47,7 +47,7 @@ void ITRON_Init( void )
status = cre_tsk( TA2_ID, &pk_ctsk ); status = cre_tsk( TA2_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA2" ); directive_failed( status, "cre_tsk of TA2" );
pk_ctsk.itskpri = 1; pk_ctsk.itskpri = 1;
pk_ctsk.task = Task_3; pk_ctsk.task = Task_3;
status = cre_tsk( TA3_ID, &pk_ctsk ); status = cre_tsk( TA3_ID, &pk_ctsk );
directive_failed( status, "cre_tsk of TA3" ); directive_failed( status, "cre_tsk of TA3" );
@@ -57,7 +57,7 @@ void ITRON_Init( void )
/* dispatching disabled */ /* dispatching disabled */
directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 ); directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 );
status = sta_tsk( TA1_ID, 0 ); status = sta_tsk( TA1_ID, 0 );
directive_failed_with_level( status, "sta_tsk of TA1", 1 ); directive_failed_with_level( status, "sta_tsk of TA1", 1 );
status = sta_tsk( TA2_ID, 0 ); status = sta_tsk( TA2_ID, 0 );

View File

@@ -29,7 +29,7 @@ void Task_3()
puts("TA3 - frsm_tsk TA1"); puts("TA3 - frsm_tsk TA1");
status = frsm_tsk( TA1_ID ); status = frsm_tsk( TA1_ID );
directive_failed( status, "TA3 - frsm_tsk TA1" ); directive_failed( status, "TA3 - frsm_tsk TA1" );
puts("TA3 - rsm_tsk TA2"); puts("TA3 - rsm_tsk TA2");
status = rsm_tsk( TA2_ID ); status = rsm_tsk( TA2_ID );
directive_failed( status, "TA3 - rsm_tsk TA2" ); directive_failed( status, "TA3 - rsm_tsk TA2" );

View File

@@ -27,10 +27,10 @@
/* /*
* get the current time in second since epoch (1970), change it since 1985, * get the current time in second since epoch (1970), change it since 1985,
* compute the time in millisecond * compute the time in millisecond
* *
*/ */
int time_sec_epoch( void ) { int time_sec_epoch( void ) {
int s_time,t_time,r_time; int s_time,t_time,r_time;
@@ -47,7 +47,7 @@ printf( "Time from 1985: %d\n", r_time );
printf("milliseconds: %ld\n",m_sec); printf("milliseconds: %ld\n",m_sec);
return 0; return 0;
} }

View File

@@ -26,7 +26,7 @@
#define TM_THURSDAY 4 #define TM_THURSDAY 4
#define TM_FRIDAY 5 #define TM_FRIDAY 5
#define TM_SATURDAY 6 #define TM_SATURDAY 6
#define TM_JANUARY 0 #define TM_JANUARY 0
#define TM_FEBRUARY 1 #define TM_FEBRUARY 1
#define TM_MARCH 2 #define TM_MARCH 2
@@ -39,7 +39,7 @@
#define TM_OCTOBER 10 #define TM_OCTOBER 10
#define TM_NOVEMBER 12 #define TM_NOVEMBER 12
#define TM_DECEMBER 12 #define TM_DECEMBER 12
#ifndef build_time #ifndef build_time
#define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \ #define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \
{ (TM)->tm_year = YR; \ { (TM)->tm_year = YR; \
@@ -65,7 +65,7 @@
\ \
status = clock_settime( CLOCK_REALTIME, &tv ); \ status = clock_settime( CLOCK_REALTIME, &tv ); \
assert( !status ); \ assert( !status ); \
} while ( 0 ) } while ( 0 )
#define print_current_time(s1, s2) \ #define print_current_time(s1, s2) \
do { \ do { \

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -39,7 +39,7 @@ void *POSIX_Init(
status = uname( NULL ); status = uname( NULL );
assert( status == -1 ); assert( status == -1 );
assert( errno == EFAULT ); assert( errno == EFAULT );
status = uname( &uts ); status = uname( &uts );
assert( !status ); assert( !status );
printf( "Init: uts.sysname: %s\n", uts.sysname ); printf( "Init: uts.sysname: %s\n", uts.sysname );
@@ -48,7 +48,7 @@ void *POSIX_Init(
printf( "Init: uts.version: %s\n", uts.version ); printf( "Init: uts.version: %s\n", uts.version );
printf( "Init: uts.machine: %s\n", uts.machine ); printf( "Init: uts.machine: %s\n", uts.machine );
puts(""); puts("");
/* error cases in clock_gettime and clock_settime */ /* error cases in clock_gettime and clock_settime */
puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
@@ -113,7 +113,7 @@ void *POSIX_Init(
printf( ctime( &seconds ) ); printf( ctime( &seconds ) );
/* just to have the value copied out through the parameter */ /* just to have the value copied out through the parameter */
seconds = time( &seconds1 ); seconds = time( &seconds1 );
assert( seconds == seconds1 ); assert( seconds == seconds1 );
@@ -146,10 +146,10 @@ void *POSIX_Init(
/* use nanosleep to yield */ /* use nanosleep to yield */
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_nsec = 0; tv.tv_nsec = 0;
puts( "Init: nanosleep - yield" ); puts( "Init: nanosleep - yield" );
status = nanosleep ( &tv, &tr ); status = nanosleep ( &tv, &tr );
assert( !status ); assert( !status );
assert( !tr.tv_sec ); assert( !tr.tv_sec );
@@ -157,10 +157,10 @@ void *POSIX_Init(
/* use nanosleep to delay */ /* use nanosleep to delay */
tv.tv_sec = 3; tv.tv_sec = 3;
tv.tv_nsec = 500000; tv.tv_nsec = 500000;
puts( "Init: nanosleep - 3.05 seconds" ); puts( "Init: nanosleep - 3.05 seconds" );
status = nanosleep ( &tv, &tr ); status = nanosleep ( &tv, &tr );
assert( !status ); assert( !status );
@@ -168,7 +168,7 @@ void *POSIX_Init(
status = clock_gettime( CLOCK_REALTIME, &tv ); status = clock_gettime( CLOCK_REALTIME, &tv );
assert( !status ); assert( !status );
printf( ctime( &tv.tv_sec ) ); printf( ctime( &tv.tv_sec ) );
/* check the time remaining */ /* check the time remaining */
@@ -193,7 +193,7 @@ void *POSIX_Init(
assert( errno == EINVAL ); assert( errno == EINVAL );
/* exercise get maximum priority */ /* exercise get maximum priority */
priority = sched_get_priority_max( SCHED_FIFO ); priority = sched_get_priority_max( SCHED_FIFO );
printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority ); printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority );
assert( priority != -1 ); assert( priority != -1 );
@@ -204,7 +204,7 @@ void *POSIX_Init(
assert( errno == EINVAL ); assert( errno == EINVAL );
/* print the round robin time quantum */ /* print the round robin time quantum */
status = sched_rr_get_interval( getpid(), &tr ); status = sched_rr_get_interval( getpid(), &tr );
printf( printf(
"Init: Round Robin quantum is %ld seconds, %ld nanoseconds\n", "Init: Round Robin quantum is %ld seconds, %ld nanoseconds\n",
@@ -212,7 +212,7 @@ void *POSIX_Init(
tr.tv_nsec tr.tv_nsec
); );
assert( !status ); assert( !status );
/* create a thread */ /* create a thread */
puts( "Init: pthread_create - SUCCESSFUL" ); puts( "Init: pthread_create - SUCCESSFUL" );

View File

@@ -36,7 +36,7 @@ void *Task_1_through_3(
puts( "Task_1: sched_yield to Init" ); puts( "Task_1: sched_yield to Init" );
status = sched_yield(); status = sched_yield();
assert( !status ); assert( !status );
/* switch to Task_1 */ /* switch to Task_1 */
/* now do some real testing */ /* now do some real testing */

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -59,7 +59,7 @@ void *POSIX_Init(
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = 0; act.sa_flags = 0;
sigaction( SIGUSR1, &act, NULL ); sigaction( SIGUSR1, &act, NULL );
/* simple signal to self */ /* simple signal to self */
@@ -87,8 +87,8 @@ void *POSIX_Init(
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
printf( "Init: send SIGUSR1 to self\n" ); printf( "Init: send SIGUSR1 to self\n" );
status = pthread_kill( Init_id, SIGUSR1 ); status = pthread_kill( Init_id, SIGUSR1 );
assert( !status ); assert( !status );
@@ -96,7 +96,7 @@ void *POSIX_Init(
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
printf( "Init: Unblock SIGUSR1\n" ); printf( "Init: Unblock SIGUSR1\n" );
status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
assert( !status ); assert( !status );
@@ -107,26 +107,26 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* /*
* Loop for 5 seconds seeing how many signals we catch * Loop for 5 seconds seeing how many signals we catch
*/ */
tr.tv_sec = 5; tr.tv_sec = 5;
tr.tv_nsec = 0; tr.tv_nsec = 0;
do { do {
tv = tr; tv = tr;
Signal_occurred = 0; Signal_occurred = 0;
status = nanosleep ( &tv, &tr ); status = nanosleep ( &tv, &tr );
if ( status == -1 ) { if ( status == -1 ) {
assert( errno == EINTR ); assert( errno == EINTR );
assert( tr.tv_nsec || tr.tv_sec ); assert( tr.tv_nsec || tr.tv_sec );
} else if ( !status ) { } else if ( !status ) {
assert( !tr.tv_nsec && !tr.tv_sec ); assert( !tr.tv_nsec && !tr.tv_sec );
} }
printf( printf(
"Init: signal was %sprocessed with %d:%d time remaining\n", "Init: signal was %sprocessed with %d:%d time remaining\n",
(Signal_occurred) ? "" : "not ", (Signal_occurred) ? "" : "not ",

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -61,7 +61,7 @@ void *POSIX_Init(
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = 0; act.sa_flags = 0;
sigaction( SIGUSR1, &act, NULL ); sigaction( SIGUSR1, &act, NULL );
/* initialize signal handler variables */ /* initialize signal handler variables */
@@ -70,7 +70,7 @@ void *POSIX_Init(
Signal_occurred = 0; Signal_occurred = 0;
/* /*
* wait on SIGUSR1 for 3 seconds, will timeout * wait on SIGUSR1 for 3 seconds, will timeout
*/ */
/* initialize the signal set we will wait for to SIGUSR1 */ /* initialize the signal set we will wait for to SIGUSR1 */
@@ -88,7 +88,7 @@ void *POSIX_Init(
signo = sigtimedwait( &waitset, &siginfo, &timeout ); signo = sigtimedwait( &waitset, &siginfo, &timeout );
assert( signo == -1 ); assert( signo == -1 );
if ( errno == EAGAIN ) if ( errno == EAGAIN )
puts( "Init: correctly timed out waiting for SIGUSR1." ); puts( "Init: correctly timed out waiting for SIGUSR1." );
else else
printf( "sigtimedwait returned wrong errno - %d\n", errno ); printf( "sigtimedwait returned wrong errno - %d\n", errno );
@@ -119,10 +119,10 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* signal handler is still installed, waitset is still set for SIGUSR1 */ /* signal handler is still installed, waitset is still set for SIGUSR1 */
timeout.tv_sec = 3; timeout.tv_sec = 3;
timeout.tv_nsec = 0; timeout.tv_nsec = 0;
puts( "Init: waiting on any signal for 3 seconds." ); puts( "Init: waiting on any signal for 3 seconds." );
signo = sigtimedwait( &waitset, &siginfo, &timeout ); signo = sigtimedwait( &waitset, &siginfo, &timeout );
@@ -133,7 +133,7 @@ void *POSIX_Init(
else else
printf( "sigtimedwait returned wrong errno - %d\n", errno ); printf( "sigtimedwait returned wrong errno - %d\n", errno );
assert( signo == -1 ); assert( signo == -1 );
/* /*
* wait on SIGUSR1 for 3 seconds, Task_2 will send it to us * wait on SIGUSR1 for 3 seconds, Task_2 will send it to us
*/ */
@@ -146,12 +146,12 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* signal handler is still installed, waitset is still set for SIGUSR1 */ /* signal handler is still installed, waitset is still set for SIGUSR1 */
/* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */ /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */
timeout.tv_sec = 3; timeout.tv_sec = 3;
timeout.tv_nsec = 0; timeout.tv_nsec = 0;
/* just so we can check that these were altered */ /* just so we can check that these were altered */
siginfo.si_code = -1; siginfo.si_code = -1;
@@ -165,7 +165,7 @@ void *POSIX_Init(
assert( siginfo.si_signo == SIGUSR1 ); assert( siginfo.si_signo == SIGUSR1 );
assert( siginfo.si_code == SI_USER ); assert( siginfo.si_code == SI_USER );
assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */ assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
/* try out a process signal */ /* try out a process signal */
empty_line(); empty_line();

View File

@@ -49,13 +49,13 @@ void *Task_2(
int status; int status;
/* send SIGUSR1 to Init which is waiting on SIGUSR1 */ /* send SIGUSR1 to Init which is waiting on SIGUSR1 */
print_current_time( "Task_2: ", "" ); print_current_time( "Task_2: ", "" );
puts( "Task_1: pthread_kill - SIGUSR1 to Init" ); puts( "Task_1: pthread_kill - SIGUSR1 to Init" );
status = pthread_kill( Init_id, SIGUSR1 ); status = pthread_kill( Init_id, SIGUSR1 );
assert( !status ); assert( !status );
pthread_exit( NULL ); pthread_exit( NULL );
/* switch to Init */ /* switch to Init */

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -108,7 +108,7 @@ void *POSIX_Init(
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = 0; act.sa_flags = 0;
sigaction( SIGUSR1, &act, NULL ); sigaction( SIGUSR1, &act, NULL );
/* simple signal to process */ /* simple signal to process */
@@ -137,7 +137,7 @@ void *POSIX_Init(
puts( "Init: Block SIGUSR1" ); puts( "Init: Block SIGUSR1" );
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = 0; act.sa_flags = 0;
sigaction( SIGUSR1, &act, NULL ); sigaction( SIGUSR1, &act, NULL );
/* simple signal to process */ /* simple signal to process */
@@ -168,7 +168,7 @@ void *POSIX_Init(
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: send SIGUSR1 to process" ); puts( "Init: send SIGUSR1 to process" );
status = kill( getpid(), SIGUSR1 ); status = kill( getpid(), SIGUSR1 );
assert( !status ); assert( !status );
@@ -176,7 +176,7 @@ void *POSIX_Init(
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: Unblock SIGUSR1" ); puts( "Init: Unblock SIGUSR1" );
status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
assert( !status ); assert( !status );
@@ -192,12 +192,12 @@ void *POSIX_Init(
puts( "Init: Block SIGUSR1" ); puts( "Init: Block SIGUSR1" );
status = sigprocmask( SIG_BLOCK, &mask, NULL ); status = sigprocmask( SIG_BLOCK, &mask, NULL );
assert( !status ); assert( !status );
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: sleep so the other task can block" ); puts( "Init: sleep so the other task can block" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
@@ -206,12 +206,12 @@ void *POSIX_Init(
puts( "Init: send SIGUSR1 to process" ); puts( "Init: send SIGUSR1 to process" );
status = kill( getpid(), SIGUSR1 ); status = kill( getpid(), SIGUSR1 );
assert( !status ); assert( !status );
status = sigpending( &pending_set ); status = sigpending( &pending_set );
assert( !status ); assert( !status );
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set ); printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: sleep so the other task can catch signal" ); puts( "Init: sleep so the other task can catch signal" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
@@ -222,27 +222,27 @@ void *POSIX_Init(
empty_line(); empty_line();
/* install a signal handler for SIGALRM and unblock it */ /* install a signal handler for SIGALRM and unblock it */
status = sigemptyset( &act.sa_mask ); status = sigemptyset( &act.sa_mask );
assert( !status ); assert( !status );
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = 0; act.sa_flags = 0;
sigaction( SIGALRM, &act, NULL ); sigaction( SIGALRM, &act, NULL );
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGALRM ); status = sigaddset( &mask, SIGALRM );
assert( !status ); assert( !status );
puts( "Init: Unblock SIGALRM" ); puts( "Init: Unblock SIGALRM" );
status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
assert( !status ); assert( !status );
/* schedule the alarm */ /* schedule the alarm */
puts( "Init: Firing alarm in 5 seconds" ); puts( "Init: Firing alarm in 5 seconds" );
status = alarm( 5 ); status = alarm( 5 );
printf( "Init: %d seconds left on previous alarm\n", status ); printf( "Init: %d seconds left on previous alarm\n", status );
@@ -264,7 +264,7 @@ void *POSIX_Init(
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGUSR1 ); status = sigaddset( &mask, SIGUSR1 );
assert( !status ); assert( !status );
@@ -277,7 +277,7 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* test inquiry about current blocked set with pthread_sigmask */ /* test inquiry about current blocked set with pthread_sigmask */
status = pthread_sigmask( 0, NULL, &oset ); status = pthread_sigmask( 0, NULL, &oset );
printf( "Init: Current blocked set is 0x%08x\n", (unsigned int) oset ); printf( "Init: Current blocked set is 0x%08x\n", (unsigned int) oset );
assert( !status ); assert( !status );
@@ -286,7 +286,7 @@ void *POSIX_Init(
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
puts( "Init: Unblock all signals" ); puts( "Init: Unblock all signals" );
status = pthread_sigmask( SIG_SETMASK, &mask, &oset ); status = pthread_sigmask( SIG_SETMASK, &mask, &oset );
printf( "Init: Previous blocked set was 0x%08x\n", (unsigned int) oset ); printf( "Init: Previous blocked set was 0x%08x\n", (unsigned int) oset );
@@ -302,7 +302,7 @@ void *POSIX_Init(
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
puts( "Init: sigsuspend for any signal" ); puts( "Init: sigsuspend for any signal" );
status = sigsuspend( &mask ); status = sigsuspend( &mask );
assert( status ); assert( status );
@@ -320,10 +320,10 @@ void *POSIX_Init(
act.sa_handler = Signal_handler; act.sa_handler = Signal_handler;
act.sa_flags = SA_SIGINFO; act.sa_flags = SA_SIGINFO;
act.sa_sigaction = Signal_info_handler; act.sa_sigaction = Signal_info_handler;
sigaction( SIGUSR1, &act, NULL ); sigaction( SIGUSR1, &act, NULL );
puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" ); puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
@@ -347,46 +347,46 @@ void *POSIX_Init(
status = kill( getpid(), SIGUSR1 ); status = kill( getpid(), SIGUSR1 );
assert( !status ); assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR1" ); puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
/* Send SIGUSR1, Task_3 has issued a sigwait */ /* Send SIGUSR1, Task_3 has issued a sigwait */
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGUSR1 ); status = sigaddset( &mask, SIGUSR1 );
assert( !status ); assert( !status );
puts( "Init: Block SIGUSR1" ); puts( "Init: Block SIGUSR1" );
status = sigprocmask( SIG_BLOCK, &mask, NULL ); status = sigprocmask( SIG_BLOCK, &mask, NULL );
assert( !status ); assert( !status );
puts( "Init: send SIGUSR1 to process" ); puts( "Init: send SIGUSR1 to process" );
status = kill( getpid(), SIGUSR1 ); status = kill( getpid(), SIGUSR1 );
assert( !status ); assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR1" ); puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
/* Send SIGUSR1, Task_3 has issued a sigwaitinfo */ /* Send SIGUSR1, Task_3 has issued a sigwaitinfo */
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGUSR2 ); status = sigaddset( &mask, SIGUSR2 );
assert( !status ); assert( !status );
puts( "Init: Block SIGUSR2" ); puts( "Init: Block SIGUSR2" );
status = sigprocmask( SIG_BLOCK, &mask, NULL ); status = sigprocmask( SIG_BLOCK, &mask, NULL );
assert( !status ); assert( !status );
puts( "Init: send SIGUSR2 to process" ); puts( "Init: send SIGUSR2 to process" );
status = kill( getpid(), SIGUSR2 ); status = kill( getpid(), SIGUSR2 );
assert( !status ); assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR2" ); puts( "Init: sleep so the Task_3 can receive SIGUSR2" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );
@@ -435,11 +435,11 @@ void *POSIX_Init(
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( errno == EINVAL ); assert( errno == EINVAL );
puts( "Init: sigdelset - EINVAL (set invalid)" ); puts( "Init: sigdelset - EINVAL (set invalid)" );
status = sigdelset( &mask, 0 ); status = sigdelset( &mask, 0 );
assert( !status ); assert( !status );
puts( "Init: sigdelset - SUCCESSFUL (signal = 0)" ); puts( "Init: sigdelset - SUCCESSFUL (signal = 0)" );
status = sigdelset( &mask, 999 ); status = sigdelset( &mask, 999 );
if ( status != -1 ) if ( status != -1 )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
@@ -451,11 +451,11 @@ void *POSIX_Init(
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( errno == EINVAL ); assert( errno == EINVAL );
puts( "Init: sigismember - EINVAL (set invalid)" ); puts( "Init: sigismember - EINVAL (set invalid)" );
status = sigismember( &mask, 0 ); status = sigismember( &mask, 0 );
assert( !status ); assert( !status );
puts( "Init: sigismember - SUCCESSFUL (signal = 0)" ); puts( "Init: sigismember - SUCCESSFUL (signal = 0)" );
status = sigismember( &mask, 999 ); status = sigismember( &mask, 999 );
if ( status != -1 ) if ( status != -1 )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
@@ -465,7 +465,7 @@ void *POSIX_Init(
status = sigaction( 0, &act, 0 ); status = sigaction( 0, &act, 0 );
assert( !status ); assert( !status );
puts( "Init: sigaction - SUCCESSFUL (signal = 0)" ); puts( "Init: sigaction - SUCCESSFUL (signal = 0)" );
status = sigaction( 999, &act, NULL ); status = sigaction( 999, &act, NULL );
if ( status != -1 ) if ( status != -1 )
printf( "status = %d\n", status ); printf( "status = %d\n", status );

View File

@@ -65,36 +65,36 @@ void *Task_3(
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGUSR1 ); status = sigaddset( &mask, SIGUSR1 );
assert( !status ); assert( !status );
printf( "Task_3: sigwait SIGUSR1\n" ); printf( "Task_3: sigwait SIGUSR1\n" );
status = sigwait( &mask, &sig ); status = sigwait( &mask, &sig );
/* switch to Init */ /* switch to Init */
assert( !status ); assert( !status );
printf( "Task_3: signo= %d\n", sig ); printf( "Task_3: signo= %d\n", sig );
/* catch signal with pause */ /* catch signal with pause */
empty_line(); empty_line();
status = sigemptyset( &mask ); status = sigemptyset( &mask );
assert( !status ); assert( !status );
status = sigaddset( &mask, SIGUSR1 ); status = sigaddset( &mask, SIGUSR1 );
assert( !status ); assert( !status );
printf( "Task_3: pause\n" ); printf( "Task_3: pause\n" );
status = pause( ); status = pause( );
/* switch to Init */ /* switch to Init */
assert( !(status==-1) ); assert( !(status==-1) );
printf( "Task_3: pause= %d\n", status ); printf( "Task_3: pause= %d\n", status );
/* send signal to Init task before it has pended for a signal */ /* send signal to Init task before it has pended for a signal */
@@ -104,7 +104,7 @@ void *Task_3(
status = pthread_kill( Init_id, SIGUSR2 ); status = pthread_kill( Init_id, SIGUSR2 );
assert( !status ); assert( !status );
printf( "Task_3: sleep so the Init task can reguest a signal\n" ); printf( "Task_3: sleep so the Init task can reguest a signal\n" );
status = sleep( 1 ); status = sleep( 1 );
assert( !status ); assert( !status );

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -13,7 +13,7 @@
#include "system.h" #include "system.h"
#include <errno.h> #include <errno.h>
#define MUTEX_BAD_ID 0xfffffffe #define MUTEX_BAD_ID 0xfffffffe
void Print_mutexattr( void Print_mutexattr(
char *msg, char *msg,
@@ -88,7 +88,7 @@ void *POSIX_Init(
int old_ceiling; int old_ceiling;
assert( MUTEX_BAD_ID != PTHREAD_MUTEX_INITIALIZER ); assert( MUTEX_BAD_ID != PTHREAD_MUTEX_INITIALIZER );
Mutex_bad_id = MUTEX_BAD_ID; Mutex_bad_id = MUTEX_BAD_ID;
puts( "\n\n*** POSIX TEST 5 ***" ); puts( "\n\n*** POSIX TEST 5 ***" );
@@ -100,7 +100,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* tes pthread_mutex_attr_init */ /* tes pthread_mutex_attr_init */
puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" );
@@ -137,11 +137,11 @@ void *POSIX_Init(
puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL attr)" );
status = pthread_mutexattr_getpshared( NULL, &pshared ); status = pthread_mutexattr_getpshared( NULL, &pshared );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared)" ); puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared)" );
status = pthread_mutexattr_getpshared( &attr, NULL ); status = pthread_mutexattr_getpshared( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getpshared - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_getpshared - EINVAL (not initialized)" );
status = pthread_mutexattr_getpshared( &destroyed_attr, &pshared ); status = pthread_mutexattr_getpshared( &destroyed_attr, &pshared );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -150,7 +150,7 @@ void *POSIX_Init(
puts( "Init: pthread_mutexattr_setpshared - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_setpshared - EINVAL (NULL attr)" );
status = pthread_mutexattr_setpshared( NULL, pshared ); status = pthread_mutexattr_setpshared( NULL, pshared );
assert( status == EINVAL ); assert( status == EINVAL );
pshared = PTHREAD_PROCESS_PRIVATE; pshared = PTHREAD_PROCESS_PRIVATE;
puts( "Init: pthread_mutexattr_setpshared - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_setpshared - EINVAL (not initialized)" );
status = pthread_mutexattr_setpshared( &destroyed_attr, pshared ); status = pthread_mutexattr_setpshared( &destroyed_attr, pshared );
@@ -163,23 +163,23 @@ void *POSIX_Init(
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr)" );
status = pthread_mutexattr_getprotocol( NULL, &protocol ); status = pthread_mutexattr_getprotocol( NULL, &protocol );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol)" ); puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol)" );
status = pthread_mutexattr_getprotocol( &attr, NULL ); status = pthread_mutexattr_getprotocol( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getprotocol - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_getprotocol - EINVAL (not initialized)" );
status = pthread_mutexattr_getprotocol( &destroyed_attr, &protocol ); status = pthread_mutexattr_getprotocol( &destroyed_attr, &protocol );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr)" );
status = pthread_mutexattr_setprotocol( NULL, PTHREAD_PRIO_NONE ); status = pthread_mutexattr_setprotocol( NULL, PTHREAD_PRIO_NONE );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol)" ); puts( "Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol)" );
status = pthread_mutexattr_setprotocol( &attr, -1 ); status = pthread_mutexattr_setprotocol( &attr, -1 );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprotocol - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_setprotocol - EINVAL (not initialized)" );
status = pthread_mutexattr_setprotocol( &destroyed_attr, -1 ); status = pthread_mutexattr_setprotocol( &destroyed_attr, -1 );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -187,29 +187,29 @@ void *POSIX_Init(
/* error cases for set and get prioceiling attribute */ /* error cases for set and get prioceiling attribute */
empty_line(); empty_line();
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr)" );
status = pthread_mutexattr_getprioceiling( NULL, &ceiling ); status = pthread_mutexattr_getprioceiling( NULL, &ceiling );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling)" ); puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling)" );
status = pthread_mutexattr_getprioceiling( &attr, NULL ); status = pthread_mutexattr_getprioceiling( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized)" );
status = pthread_mutexattr_getprioceiling( &destroyed_attr, &ceiling ); status = pthread_mutexattr_getprioceiling( &destroyed_attr, &ceiling );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr)" ); puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr)" );
status = pthread_mutexattr_setprioceiling( NULL, 128 ); status = pthread_mutexattr_setprioceiling( NULL, 128 );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority)" ); puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority)" );
status = pthread_mutexattr_setprioceiling( &attr, 512 ); status = pthread_mutexattr_setprioceiling( &attr, 512 );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized)" ); puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized)" );
status = pthread_mutexattr_setprioceiling( &destroyed_attr, -1 ); status = pthread_mutexattr_setprioceiling( &destroyed_attr, -1 );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -255,15 +255,15 @@ void *POSIX_Init(
puts( "Init: Changing mutex attributes" ); puts( "Init: Changing mutex attributes" );
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT );
assert( !status ); assert( !status );
status = pthread_mutexattr_setprioceiling( &attr, 128 ); status = pthread_mutexattr_setprioceiling( &attr, 128 );
assert( !status ); assert( !status );
status = pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); status = pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
assert( !status ); assert( !status );
Print_mutexattr( "Init: ", &attr ); Print_mutexattr( "Init: ", &attr );
puts( "Init: Resetting mutex attributes" ); puts( "Init: Resetting mutex attributes" );
status = pthread_mutexattr_init( &attr ); status = pthread_mutexattr_init( &attr );
assert( !status ); assert( !status );
@@ -275,7 +275,7 @@ void *POSIX_Init(
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT );
assert( !status ); assert( !status );
puts( "Init: pthread_mutex_init - SUCCESSFUL" ); puts( "Init: pthread_mutex_init - SUCCESSFUL" );
status = pthread_mutex_init( &Mutex_id, &attr ); status = pthread_mutex_init( &Mutex_id, &attr );
if ( status ) if ( status )
@@ -322,7 +322,7 @@ void *POSIX_Init(
puts( "Init: Sleep 1 second" ); puts( "Init: Sleep 1 second" );
sleep( 1 ); sleep( 1 );
/* switch to task 1 */ /* switch to task 1 */
puts( "Init: pthread_mutex_unlock - EINVAL (invalid id)" ); puts( "Init: pthread_mutex_unlock - EINVAL (invalid id)" );
@@ -376,15 +376,15 @@ void *POSIX_Init(
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" ); puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
status = pthread_mutex_destroy( &Mutex2_id ); status = pthread_mutex_destroy( &Mutex2_id );
assert( !status ); assert( !status );
puts( "Init: pthread_mutex_destroy - EINVAL (invalid id)" ); puts( "Init: pthread_mutex_destroy - EINVAL (invalid id)" );
status = pthread_mutex_destroy( &Mutex_bad_id ); status = pthread_mutex_destroy( &Mutex_bad_id );
assert( status == EINVAL ); assert( status == EINVAL );
/* destroy a busy mutex */ /* destroy a busy mutex */
empty_line(); empty_line();
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
status = pthread_mutexattr_init( &attr ); status = pthread_mutexattr_init( &attr );
assert( !status ); assert( !status );
@@ -392,7 +392,7 @@ void *POSIX_Init(
puts( "Init: pthread_mutex_init - SUCCESSFUL" ); puts( "Init: pthread_mutex_init - SUCCESSFUL" );
status = pthread_mutex_init( &Mutex2_id, &attr ); status = pthread_mutex_init( &Mutex2_id, &attr );
assert( !status ); assert( !status );
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
status = pthread_mutex_trylock( &Mutex2_id ); status = pthread_mutex_trylock( &Mutex2_id );
if ( status ) if ( status )
@@ -416,7 +416,7 @@ void *POSIX_Init(
/* priority inherit mutex */ /* priority inherit mutex */
empty_line(); empty_line();
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
status = pthread_mutexattr_init( &attr ); status = pthread_mutexattr_init( &attr );
assert( !status ); assert( !status );
@@ -436,14 +436,14 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* create a thread at a lower priority */ /* create a thread at a lower priority */
status = pthread_create( &Task2_id, NULL, Task_2, NULL ); status = pthread_create( &Task2_id, NULL, Task_2, NULL );
assert( !status ); assert( !status );
/* set priority of Task2 to highest priority */ /* set priority of Task2 to highest priority */
param.sched_priority = 254; param.sched_priority = 254;
puts( "Init: pthread_setschedparam - Setting Task2 priority to highest" ); puts( "Init: pthread_setschedparam - Setting Task2 priority to highest" );
status = pthread_setschedparam( Task2_id, SCHED_FIFO, &param ); status = pthread_setschedparam( Task2_id, SCHED_FIFO, &param );
assert( !status ); assert( !status );
@@ -457,7 +457,7 @@ void *POSIX_Init(
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
status = pthread_mutex_unlock( &Mutex2_id ); status = pthread_mutex_unlock( &Mutex2_id );
assert( !status ); assert( !status );
puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" ); puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" );
status = pthread_mutexattr_destroy( &attr ); status = pthread_mutexattr_destroy( &attr );
assert( !status ); assert( !status );
@@ -465,25 +465,25 @@ void *POSIX_Init(
puts( "Init: pthread_mutex_destroy - SUCCESSFUL" ); puts( "Init: pthread_mutex_destroy - SUCCESSFUL" );
status = pthread_mutex_destroy( &Mutex2_id ); status = pthread_mutex_destroy( &Mutex2_id );
assert( !status ); assert( !status );
/* priority ceiling mutex */ /* priority ceiling mutex */
empty_line(); empty_line();
puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); puts( "Init: pthread_mutexattr_init - SUCCESSFUL" );
status = pthread_mutexattr_init( &attr ); status = pthread_mutexattr_init( &attr );
assert( !status ); assert( !status );
puts( puts(
"Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT)" "Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT)"
); );
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT ); status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT );
assert( !status ); assert( !status );
puts( "Init: pthread_mutex_init - SUCCESSFUL" ); puts( "Init: pthread_mutex_init - SUCCESSFUL" );
status = pthread_mutex_init( &Mutex2_id, &attr ); status = pthread_mutex_init( &Mutex2_id, &attr );
assert( !status ); assert( !status );
puts( "Init: pthread_mutex_getprioceiling - EINVAL (invalid id)" ); puts( "Init: pthread_mutex_getprioceiling - EINVAL (invalid id)" );
status = pthread_mutex_getprioceiling( &Mutex_bad_id, &ceiling ); status = pthread_mutex_getprioceiling( &Mutex_bad_id, &ceiling );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -495,7 +495,7 @@ void *POSIX_Init(
status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling ); status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling );
assert( !status ); assert( !status );
printf( "Init: pthread_mutex_getprioceiling - %d\n", ceiling ); printf( "Init: pthread_mutex_getprioceiling - %d\n", ceiling );
puts( "Init: pthread_mutex_setprioceiling - EINVAL (invalid id)" ); puts( "Init: pthread_mutex_setprioceiling - EINVAL (invalid id)" );
status = pthread_mutex_setprioceiling( &Mutex_bad_id, 200, &old_ceiling ); status = pthread_mutex_setprioceiling( &Mutex_bad_id, 200, &old_ceiling );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -516,7 +516,7 @@ void *POSIX_Init(
printf( printf(
"Init: pthread_mutex_setprioceiling - old ceiling = %d\n",old_ceiling "Init: pthread_mutex_setprioceiling - old ceiling = %d\n",old_ceiling
); );
status = pthread_getschedparam( pthread_self(), &policy, &param ); status = pthread_getschedparam( pthread_self(), &policy, &param );
assert( !status ); assert( !status );
printf( printf(
@@ -526,7 +526,7 @@ void *POSIX_Init(
puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); puts( "Init: pthread_mutex_trylock - SUCCESSFUL" );
status = pthread_mutex_trylock( &Mutex2_id ); status = pthread_mutex_trylock( &Mutex2_id );
assert( !status ); assert( !status );
status = pthread_getschedparam( pthread_self(), &policy, &param ); status = pthread_getschedparam( pthread_self(), &policy, &param );
assert( !status ); assert( !status );
printf( printf(
@@ -534,42 +534,42 @@ void *POSIX_Init(
); );
/* create a thread at a higher priority */ /* create a thread at a higher priority */
status = pthread_create( &Task3_id, NULL, Task_3, NULL ); status = pthread_create( &Task3_id, NULL, Task_3, NULL );
assert( !status ); assert( !status );
/* set priority of Task3 to highest priority */ /* set priority of Task3 to highest priority */
param.sched_priority = 199; param.sched_priority = 199;
status = pthread_setschedparam( Task3_id, SCHED_FIFO, &param ); status = pthread_setschedparam( Task3_id, SCHED_FIFO, &param );
assert( !status ); assert( !status );
puts( "Init: pthread_setschedparam - set Task3 priority to highest" ); puts( "Init: pthread_setschedparam - set Task3 priority to highest" );
/* DOES NOT SWITCH to Task3 */ /* DOES NOT SWITCH to Task3 */
puts( "Init: Sleep 1 second" ); puts( "Init: Sleep 1 second" );
assert( !status ); assert( !status );
sleep( 1 ); sleep( 1 );
/* switch to task 3 */ /* switch to task 3 */
puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); puts( "Init: pthread_mutex_unlock - SUCCESSFUL" );
status = pthread_mutex_unlock( &Mutex2_id ); status = pthread_mutex_unlock( &Mutex2_id );
assert( !status ); assert( !status );
status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling ); status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling );
assert( !status ); assert( !status );
printf( "Init: pthread_mutex_getprioceiling- ceiling = %d\n", ceiling ); printf( "Init: pthread_mutex_getprioceiling- ceiling = %d\n", ceiling );
/* set priority of Init to highest priority */ /* set priority of Init to highest priority */
param.sched_priority = 254; param.sched_priority = 254;
status = pthread_setschedparam( Init_id, SCHED_FIFO, &param ); status = pthread_setschedparam( Init_id, SCHED_FIFO, &param );
assert( !status ); assert( !status );
puts( "Init: pthread_setschedparam - set Init priority to highest" ); puts( "Init: pthread_setschedparam - set Init priority to highest" );
puts( "Init: pthread_mutex_lock - EINVAL (priority ceiling violation)" ); puts( "Init: pthread_mutex_lock - EINVAL (priority ceiling violation)" );
status = pthread_mutex_lock( &Mutex2_id ); status = pthread_mutex_lock( &Mutex2_id );
if ( status != EINVAL ) if ( status != EINVAL )

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -46,7 +46,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* create a couple of threads */ /* create a couple of threads */
status = pthread_create( &Task_id, NULL, Task_1, NULL ); status = pthread_create( &Task_id, NULL, Task_1, NULL );

View File

@@ -26,14 +26,14 @@ void *Task_1(
) )
{ {
int status; int status;
uint32_t *key_data; uint32_t *key_data;
printf( "Task_1: Setting the key to %d\n", 1 ); printf( "Task_1: Setting the key to %d\n", 1 );
status = pthread_setspecific( Key_id, &Data_array[ 1 ] ); status = pthread_setspecific( Key_id, &Data_array[ 1 ] );
if ( status ) if ( status )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( !status ); assert( !status );
key_data = pthread_getspecific( Key_id ); key_data = pthread_getspecific( Key_id );
printf( "Task_1: Got the key value of %ld\n", printf( "Task_1: Got the key value of %ld\n",
(unsigned long) ((uint32_t *)key_data - Data_array) ); (unsigned long) ((uint32_t *)key_data - Data_array) );

View File

@@ -26,7 +26,7 @@ void *Task_2(
{ {
int status; int status;
uint32_t *key_data; uint32_t *key_data;
printf( "Destructor invoked %d times\n", Destructor_invoked ); printf( "Destructor invoked %d times\n", Destructor_invoked );
printf( "Task_2: Setting the key to %d\n", 2 ); printf( "Task_2: Setting the key to %d\n", 2 );
@@ -34,18 +34,18 @@ void *Task_2(
if ( status ) if ( status )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( !status ); assert( !status );
key_data = pthread_getspecific( Key_id ); key_data = pthread_getspecific( Key_id );
printf( "Task_2: Got the key value of %ld\n", printf( "Task_2: Got the key value of %ld\n",
(unsigned long) ((uint32_t *)key_data - Data_array) ); (unsigned long) ((uint32_t *)key_data - Data_array) );
if ( status ) if ( status )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( !status ); assert( !status );
puts( "Task2: exitting" ); puts( "Task2: exitting" );
pthread_exit( NULL ); pthread_exit( NULL );
/* switch to init task */ /* switch to init task */
return NULL; /* just so the compiler thinks we returned something */ return NULL; /* just so the compiler thinks we returned something */
} }

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -18,7 +18,7 @@ void print_schedparam(
struct sched_param *schedparam struct sched_param *schedparam
) )
{ {
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority ); printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
#if defined(_POSIX_SPORADIC_SERVER) #if defined(_POSIX_SPORADIC_SERVER)
printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority ); printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority );
printf( "%sss_replenish_period = (%ld, %ld)\n", prefix, printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
@@ -31,7 +31,7 @@ void print_schedparam(
printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" ); printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
#endif #endif
} }
void *POSIX_Init( void *POSIX_Init(
void *argument void *argument
) )
@@ -57,7 +57,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* exercise init and destroy */ /* exercise init and destroy */
puts( "Init: pthread_attr_init - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_init - EINVAL (NULL attr)" );
@@ -92,10 +92,10 @@ void *POSIX_Init(
/* junk stack address */ /* junk stack address */
status = pthread_attr_setstackaddr( &attr, (void *)&schedparam ); status = pthread_attr_setstackaddr( &attr, (void *)&schedparam );
assert( !status ); assert( !status );
/* must go around pthread_attr_setstacksize to set a bad stack size */ /* must go around pthread_attr_setstacksize to set a bad stack size */
attr.stacksize = 0; attr.stacksize = 0;
puts( "Init: pthread_create - EINVAL (stacksize too small)" ); puts( "Init: pthread_create - EINVAL (stacksize too small)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -114,7 +114,7 @@ void *POSIX_Init(
/* must go around pthread_attr_set routines to set a bad value */ /* must go around pthread_attr_set routines to set a bad value */
attr.inheritsched = -1; attr.inheritsched = -1;
puts( "Init: pthread_create - EINVAL (invalid inherit scheduler)" ); puts( "Init: pthread_create - EINVAL (invalid inherit scheduler)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -138,7 +138,7 @@ void *POSIX_Init(
status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED ); status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED );
assert( !status ); assert( !status );
puts( "Init: pthread_create - SUCCESSFUL (inherit scheduler)" ); puts( "Init: pthread_create - SUCCESSFUL (inherit scheduler)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( !status ); assert( !status );
@@ -174,19 +174,19 @@ void *POSIX_Init(
puts( "Init: pthread_attr_setscope - SUCCESSFUL" ); puts( "Init: pthread_attr_setscope - SUCCESSFUL" );
status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_PROCESS ); status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_PROCESS );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getscope - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getscope - EINVAL (NULL attr)" );
status = pthread_attr_getscope( NULL, &scope ); status = pthread_attr_getscope( NULL, &scope );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getscope - EINVAL (NULL scope)" ); puts( "Init: pthread_attr_getscope - EINVAL (NULL scope)" );
status = pthread_attr_getscope( &attr, NULL ); status = pthread_attr_getscope( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getscope - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getscope - EINVAL (not initialized attr)" );
status = pthread_attr_getscope( &destroyed_attr, &scope ); status = pthread_attr_getscope( &destroyed_attr, &scope );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getscope - SUCCESSFUL" ); puts( "Init: pthread_attr_getscope - SUCCESSFUL" );
status = pthread_attr_getscope( &attr, &scope ); status = pthread_attr_getscope( &attr, &scope );
assert( !status ); assert( !status );
@@ -199,88 +199,88 @@ void *POSIX_Init(
puts( "Init: pthread_attr_setinheritsched - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setinheritsched - EINVAL (NULL attr)" );
status = pthread_attr_setinheritsched( NULL, PTHREAD_INHERIT_SCHED ); status = pthread_attr_setinheritsched( NULL, PTHREAD_INHERIT_SCHED );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)" );
status = status =
pthread_attr_setinheritsched( &destroyed_attr, PTHREAD_INHERIT_SCHED ); pthread_attr_setinheritsched( &destroyed_attr, PTHREAD_INHERIT_SCHED );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" ); puts( "Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" );
status = pthread_attr_setinheritsched( &attr, -1 ); status = pthread_attr_setinheritsched( &attr, -1 );
assert( status == ENOTSUP ); assert( status == ENOTSUP );
puts( "Init: pthread_attr_setinheritsched - SUCCESSFUL" ); puts( "Init: pthread_attr_setinheritsched - SUCCESSFUL" );
status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED ); status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL attr)" );
status = pthread_attr_getinheritsched( NULL, &inheritsched ); status = pthread_attr_getinheritsched( NULL, &inheritsched );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" ); puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" );
status = pthread_attr_getinheritsched( &attr, NULL ); status = pthread_attr_getinheritsched( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)" );
status = pthread_attr_getinheritsched( &destroyed_attr, &inheritsched ); status = pthread_attr_getinheritsched( &destroyed_attr, &inheritsched );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getinheritsched - SUCCESSFUL" ); puts( "Init: pthread_attr_getinheritsched - SUCCESSFUL" );
status = pthread_attr_getinheritsched( &attr, &inheritsched ); status = pthread_attr_getinheritsched( &attr, &inheritsched );
assert( !status ); assert( !status );
printf( "Init: current inherit scheduler attribute = %d\n", inheritsched ); printf( "Init: current inherit scheduler attribute = %d\n", inheritsched );
/* exercise get and set inherit scheduler */ /* exercise get and set inherit scheduler */
empty_line(); empty_line();
puts( "Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)" );
status = pthread_attr_setschedpolicy( NULL, SCHED_FIFO ); status = pthread_attr_setschedpolicy( NULL, SCHED_FIFO );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)" );
status = status =
pthread_attr_setschedpolicy( &destroyed_attr, SCHED_OTHER ); pthread_attr_setschedpolicy( &destroyed_attr, SCHED_OTHER );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" ); puts( "Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" );
status = pthread_attr_setschedpolicy( &attr, -1 ); status = pthread_attr_setschedpolicy( &attr, -1 );
assert( status == ENOTSUP ); assert( status == ENOTSUP );
puts( "Init: pthread_attr_setschedpolicy - SUCCESSFUL" ); puts( "Init: pthread_attr_setschedpolicy - SUCCESSFUL" );
status = pthread_attr_setschedpolicy( &attr, SCHED_RR ); status = pthread_attr_setschedpolicy( &attr, SCHED_RR );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)" );
status = pthread_attr_getschedpolicy( NULL, &schedpolicy ); status = pthread_attr_getschedpolicy( NULL, &schedpolicy );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" ); puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" );
status = pthread_attr_getschedpolicy( &attr, NULL ); status = pthread_attr_getschedpolicy( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)" );
status = pthread_attr_getschedpolicy( &destroyed_attr, &schedpolicy ); status = pthread_attr_getschedpolicy( &destroyed_attr, &schedpolicy );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getschedpolicy - SUCCESSFUL" ); puts( "Init: pthread_attr_getschedpolicy - SUCCESSFUL" );
status = pthread_attr_getschedpolicy( &attr, &schedpolicy ); status = pthread_attr_getschedpolicy( &attr, &schedpolicy );
assert( !status ); assert( !status );
printf( "Init: current scheduler policy attribute = %d\n", schedpolicy ); printf( "Init: current scheduler policy attribute = %d\n", schedpolicy );
/* exercise get and set stack size */ /* exercise get and set stack size */
empty_line(); empty_line();
puts( "Init: pthread_attr_setstacksize - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setstacksize - EINVAL (NULL attr)" );
status = pthread_attr_setstacksize( NULL, 0 ); status = pthread_attr_setstacksize( NULL, 0 );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setstacksize - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setstacksize - EINVAL (not initialized attr)" );
status = status =
pthread_attr_setstacksize( &destroyed_attr, 0 ); pthread_attr_setstacksize( &destroyed_attr, 0 );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" ); puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" );
status = pthread_attr_setstacksize( &attr, 0 ); status = pthread_attr_setstacksize( &attr, 0 );
assert( !status ); assert( !status );
@@ -288,19 +288,19 @@ void *POSIX_Init(
puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" ); puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" );
status = pthread_attr_setstacksize( &attr, STACK_MINIMUM_SIZE * 2 ); status = pthread_attr_setstacksize( &attr, STACK_MINIMUM_SIZE * 2 );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getstacksize - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getstacksize - EINVAL (NULL attr)" );
status = pthread_attr_getstacksize( NULL, &stacksize ); status = pthread_attr_getstacksize( NULL, &stacksize );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)" ); puts( "Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)" );
status = pthread_attr_getstacksize( &attr, NULL ); status = pthread_attr_getstacksize( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstacksize - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getstacksize - EINVAL (not initialized attr)" );
status = pthread_attr_getstacksize( &destroyed_attr, &stacksize ); status = pthread_attr_getstacksize( &destroyed_attr, &stacksize );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstacksize - SUCCESSFUL" ); puts( "Init: pthread_attr_getstacksize - SUCCESSFUL" );
status = pthread_attr_getstacksize( &attr, &stacksize ); status = pthread_attr_getstacksize( &attr, &stacksize );
assert( !status ); assert( !status );
@@ -308,72 +308,72 @@ void *POSIX_Init(
printf( "Init: current stack size attribute is OK\n" ); printf( "Init: current stack size attribute is OK\n" );
/* exercise get and set stack address */ /* exercise get and set stack address */
empty_line(); empty_line();
puts( "Init: pthread_attr_setstackaddr - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setstackaddr - EINVAL (NULL attr)" );
status = pthread_attr_setstackaddr( NULL, NULL ); status = pthread_attr_setstackaddr( NULL, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)" );
status = status =
pthread_attr_setstackaddr( &destroyed_attr, NULL ); pthread_attr_setstackaddr( &destroyed_attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setstackaddr - SUCCESSFUL" ); puts( "Init: pthread_attr_setstackaddr - SUCCESSFUL" );
status = pthread_attr_setstackaddr( &attr, 0 ); status = pthread_attr_setstackaddr( &attr, 0 );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL attr)" );
status = pthread_attr_getstackaddr( NULL, &stackaddr ); status = pthread_attr_getstackaddr( NULL, &stackaddr );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" ); puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" );
status = pthread_attr_getstackaddr( &attr, NULL ); status = pthread_attr_getstackaddr( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)" );
status = pthread_attr_getstackaddr( &destroyed_attr, &stackaddr ); status = pthread_attr_getstackaddr( &destroyed_attr, &stackaddr );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getstackaddr - SUCCESSFUL" ); puts( "Init: pthread_attr_getstackaddr - SUCCESSFUL" );
status = pthread_attr_getstackaddr( &attr, &stackaddr ); status = pthread_attr_getstackaddr( &attr, &stackaddr );
assert( !status ); assert( !status );
printf( "Init: current stack address attribute = %p\n", stackaddr ); printf( "Init: current stack address attribute = %p\n", stackaddr );
/* exercise get and set detach state */ /* exercise get and set detach state */
empty_line(); empty_line();
puts( "Init: pthread_attr_setdetachstate - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setdetachstate - EINVAL (NULL attr)" );
status = pthread_attr_setdetachstate( NULL, PTHREAD_CREATE_DETACHED ); status = pthread_attr_setdetachstate( NULL, PTHREAD_CREATE_DETACHED );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)" );
status = status =
pthread_attr_setdetachstate( &destroyed_attr, PTHREAD_CREATE_JOINABLE ); pthread_attr_setdetachstate( &destroyed_attr, PTHREAD_CREATE_JOINABLE );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)" ); puts( "Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)" );
status = pthread_attr_setdetachstate( &attr, -1 ); status = pthread_attr_setdetachstate( &attr, -1 );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setdetachstate - SUCCESSFUL" ); puts( "Init: pthread_attr_setdetachstate - SUCCESSFUL" );
status = pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); status = pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL attr)" );
status = pthread_attr_getdetachstate( NULL, &detachstate ); status = pthread_attr_getdetachstate( NULL, &detachstate );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" ); puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" );
status = pthread_attr_getdetachstate( &attr, NULL ); status = pthread_attr_getdetachstate( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)" );
status = pthread_attr_getdetachstate( &destroyed_attr, &detachstate ); status = pthread_attr_getdetachstate( &destroyed_attr, &detachstate );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getdetachstate - SUCCESSFUL" ); puts( "Init: pthread_attr_getdetachstate - SUCCESSFUL" );
status = pthread_attr_getdetachstate( &attr, &detachstate ); status = pthread_attr_getdetachstate( &attr, &detachstate );
assert( !status ); assert( !status );
@@ -392,31 +392,31 @@ void *POSIX_Init(
puts( "Init: pthread_attr_setschedparam - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_setschedparam - EINVAL (NULL attr)" );
status = pthread_attr_setschedparam( NULL, &schedparam ); status = pthread_attr_setschedparam( NULL, &schedparam );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setschedparam - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_setschedparam - EINVAL (not initialized attr)" );
status = pthread_attr_setschedparam( &destroyed_attr, &schedparam ); status = pthread_attr_setschedparam( &destroyed_attr, &schedparam );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)" ); puts( "Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)" );
status = pthread_attr_setschedparam( &attr, NULL ); status = pthread_attr_setschedparam( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_setschedparam - SUCCESSFUL" ); puts( "Init: pthread_attr_setschedparam - SUCCESSFUL" );
status = pthread_attr_setschedparam( &attr, &schedparam ); status = pthread_attr_setschedparam( &attr, &schedparam );
assert( !status ); assert( !status );
puts( "Init: pthread_attr_getschedparam - EINVAL (NULL attr)" ); puts( "Init: pthread_attr_getschedparam - EINVAL (NULL attr)" );
status = pthread_attr_getschedparam( NULL, &schedparam ); status = pthread_attr_getschedparam( NULL, &schedparam );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getschedparam - EINVAL (not initialized attr)" ); puts( "Init: pthread_attr_getschedparam - EINVAL (not initialized attr)" );
status = pthread_attr_getschedparam( &destroyed_attr, &schedparam ); status = pthread_attr_getschedparam( &destroyed_attr, &schedparam );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)" ); puts( "Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)" );
status = pthread_attr_getschedparam( &attr, NULL ); status = pthread_attr_getschedparam( &attr, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
/* exercise pthread_getschedparam */ /* exercise pthread_getschedparam */
empty_line(); empty_line();
@@ -424,19 +424,19 @@ void *POSIX_Init(
puts( "Init: pthread_getschedparam - EINVAL (NULL policy)" ); puts( "Init: pthread_getschedparam - EINVAL (NULL policy)" );
status = pthread_getschedparam( pthread_self(), NULL, &schedparam ); status = pthread_getschedparam( pthread_self(), NULL, &schedparam );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_getschedparam - EINVAL (NULL schedparam)" ); puts( "Init: pthread_getschedparam - EINVAL (NULL schedparam)" );
status = pthread_getschedparam( pthread_self(), &schedpolicy, NULL ); status = pthread_getschedparam( pthread_self(), &schedpolicy, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_getschedparam - ESRCH (bad thread)" ); puts( "Init: pthread_getschedparam - ESRCH (bad thread)" );
status = pthread_getschedparam( -1, &schedpolicy, &schedparam ); status = pthread_getschedparam( -1, &schedpolicy, &schedparam );
assert( status == ESRCH ); assert( status == ESRCH );
puts( "Init: pthread_getschedparam - SUCCESSFUL" ); puts( "Init: pthread_getschedparam - SUCCESSFUL" );
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
printf( "Init: policy = %d\n", schedpolicy ); printf( "Init: policy = %d\n", schedpolicy );
print_schedparam( "Init: ", &schedparam ); print_schedparam( "Init: ", &schedparam );
@@ -465,7 +465,7 @@ void *POSIX_Init(
status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam ); status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam );
assert( status == ESRCH ); assert( status == ESRCH );
/* now get sporadic server errors */ /* now get sporadic server errors */
schedparam.ss_replenish_period.tv_sec = 1; schedparam.ss_replenish_period.tv_sec = 1;
schedparam.ss_replenish_period.tv_nsec = 0; schedparam.ss_replenish_period.tv_nsec = 0;

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -42,10 +42,10 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* create thread */ /* create thread */
status = pthread_create( &Task1_id, NULL, Task_1, NULL ); status = pthread_create( &Task1_id, NULL, Task_1, NULL );
assert( !status ); assert( !status );
puts( "Init: pthread_join - ESRCH (invalid id)" ); puts( "Init: pthread_join - ESRCH (invalid id)" );
status = pthread_join( -1, &return_pointer ); status = pthread_join( -1, &return_pointer );
assert( status == ESRCH ); assert( status == ESRCH );
@@ -66,14 +66,14 @@ void *POSIX_Init(
return_pointer, return_pointer,
&Task1_id &Task1_id
); );
puts( "Init: creating two pthreads" ); puts( "Init: creating two pthreads" );
status = pthread_create( &Task2_id, NULL, Task_2, NULL ); status = pthread_create( &Task2_id, NULL, Task_2, NULL );
assert( !status ); assert( !status );
status = pthread_create( &Task3_id, NULL, Task_3, NULL ); status = pthread_create( &Task3_id, NULL, Task_3, NULL );
assert( !status ); assert( !status );
puts( "Init: pthread_join - SUCCESSFUL" ); puts( "Init: pthread_join - SUCCESSFUL" );
status = pthread_join( Task2_id, &return_pointer ); status = pthread_join( Task2_id, &return_pointer );
/* assert is below comment */ /* assert is below comment */
@@ -91,7 +91,7 @@ void *POSIX_Init(
return_pointer, return_pointer,
&Task2_id &Task2_id
); );
puts( "Init: exitting" ); puts( "Init: exitting" );
return NULL; return NULL;
} }

View File

@@ -38,7 +38,7 @@ void *Task_2(
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Task_2: join to self task (Init) -- EDEADLK" ); puts( "Task_2: join to self task (Init) -- EDEADLK" );
status = pthread_join( pthread_self(), NULL ); status = pthread_join( pthread_self(), NULL );
if ( status != EDEADLK ) if ( status != EDEADLK )

View File

@@ -34,7 +34,7 @@ void *Task_3(
if ( status ) if ( status )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( !status ); assert( !status );
if ( return_pointer == &Task2_id ) if ( return_pointer == &Task2_id )
puts( "Task_3: pthread_join returned correct pointer" ); puts( "Task_3: pthread_join returned correct pointer" );
else else

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -54,7 +54,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* try to use this thread as a sporadic server */ /* try to use this thread as a sporadic server */
puts( "Init: pthread_getschedparam - SUCCESSFUL" ); puts( "Init: pthread_getschedparam - SUCCESSFUL" );
@@ -89,7 +89,7 @@ void *POSIX_Init(
for ( passes=0 ; passes <= 3 ; ) { for ( passes=0 ; passes <= 3 ; ) {
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
if ( priority != schedparam.sched_priority ) { if ( priority != schedparam.sched_priority ) {
priority = schedparam.sched_priority; priority = schedparam.sched_priority;
sprintf( buffer, " - new priority = %d", priority ); sprintf( buffer, " - new priority = %d", priority );
@@ -117,7 +117,7 @@ void *POSIX_Init(
schedparam.sched_priority = HIGH_PRIORITY; schedparam.sched_priority = HIGH_PRIORITY;
schedparam.ss_low_priority = LOW_PRIORITY; schedparam.ss_low_priority = LOW_PRIORITY;
puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" ); puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam ); status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
assert( !status ); assert( !status );
@@ -128,10 +128,10 @@ void *POSIX_Init(
status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT ); status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT );
assert( !status ); assert( !status );
status = pthread_mutexattr_setprioceiling( &attr, MEDIUM_PRIORITY ); status = pthread_mutexattr_setprioceiling( &attr, MEDIUM_PRIORITY );
assert( !status ); assert( !status );
puts( "Init: Creating a mutex" ); puts( "Init: Creating a mutex" );
status = pthread_mutex_init( &Mutex_id, &attr ); status = pthread_mutex_init( &Mutex_id, &attr );
if ( status ) if ( status )
@@ -140,7 +140,7 @@ void *POSIX_Init(
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
priority = schedparam.sched_priority; priority = schedparam.sched_priority;
sprintf( buffer, " - new priority = %d", priority ); sprintf( buffer, " - new priority = %d", priority );
print_current_time( "Init: ", buffer ); print_current_time( "Init: ", buffer );
@@ -179,18 +179,18 @@ void *POSIX_Init(
for ( ; ; ) { for ( ; ; ) {
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
if ( schedparam.sched_priority == HIGH_PRIORITY ) if ( schedparam.sched_priority == HIGH_PRIORITY )
break; break;
} }
priority = schedparam.sched_priority; priority = schedparam.sched_priority;
sprintf( buffer, " - new priority = %d", priority ); sprintf( buffer, " - new priority = %d", priority );
print_current_time( "Init: ", buffer ); print_current_time( "Init: ", buffer );
/* with this unlock we should be able to go to low priority */ /* with this unlock we should be able to go to low priority */
puts( "Init: unlock mutex" ); puts( "Init: unlock mutex" );
status = pthread_mutex_unlock( &Mutex_id ); status = pthread_mutex_unlock( &Mutex_id );
if ( status ) if ( status )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
@@ -206,14 +206,14 @@ void *POSIX_Init(
for ( ; ; ) { for ( ; ; ) {
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
if ( schedparam.sched_priority == LOW_PRIORITY ) if ( schedparam.sched_priority == LOW_PRIORITY )
break; break;
} }
status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
assert( !status ); assert( !status );
priority = schedparam.sched_priority; priority = schedparam.sched_priority;
sprintf( buffer, " - new priority = %d", priority ); sprintf( buffer, " - new priority = %d", priority );
print_current_time( "Init: ", buffer ); print_current_time( "Init: ", buffer );

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -221,7 +221,7 @@ void *POSIX_Init(
printf( "status = %d\n", status ); printf( "status = %d\n", status );
assert( status == EINVAL ); assert( status == EINVAL );
puts( "Init: pthread_cond_wait - EINVAL (mutex invalid)" ); puts( "Init: pthread_cond_wait - EINVAL (mutex invalid)" );
status = pthread_cond_timedwait( &Cond1_id, NULL, &timeout ); status = pthread_cond_timedwait( &Cond1_id, NULL, &timeout );
if ( status != EINVAL ) if ( status != EINVAL )
printf( "status = %d\n", status ); printf( "status = %d\n", status );
@@ -261,7 +261,7 @@ void *POSIX_Init(
/* wait and timedwait without mutex */ /* wait and timedwait without mutex */
/* XXX - this case is commented out in the code pending review /* XXX - this case is commented out in the code pending review
* *
* status = pthread_cond_wait( &Cond1_id, &Mutex_id ); * status = pthread_cond_wait( &Cond1_id, &Mutex_id );
* if ( status != EINVAL ) * if ( status != EINVAL )
* printf( "status = %d\n", status ); * printf( "status = %d\n", status );
@@ -270,7 +270,7 @@ void *POSIX_Init(
puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" ); puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" );
/* XXX - this case is commented out in the code pending review /* XXX - this case is commented out in the code pending review
* *
* status = clock_gettime( CLOCK_REALTIME, &timeout ); * status = clock_gettime( CLOCK_REALTIME, &timeout );
* assert( !status ); * assert( !status );
* timeout.tv_sec += 1; * timeout.tv_sec += 1;

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -31,7 +31,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* exercise pthread_setschedparam */ /* exercise pthread_setschedparam */
param.sched_priority = 127; param.sched_priority = 127;
@@ -53,33 +53,33 @@ void *POSIX_Init(
assert( !status ); assert( !status );
/* create a thread as SCHED_FIFO */ /* create a thread as SCHED_FIFO */
puts( "Init: create a thread of SCHED_FIFO with priority 120" ); puts( "Init: create a thread of SCHED_FIFO with priority 120" );
status = pthread_attr_init( &attr ); status = pthread_attr_init( &attr );
assert( !status ); assert( !status );
attr.schedpolicy = SCHED_FIFO; attr.schedpolicy = SCHED_FIFO;
attr.schedparam.sched_priority = 120; attr.schedparam.sched_priority = 120;
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( !status ); assert( !status );
puts( "Init: join with the other thread" ); puts( "Init: join with the other thread" );
status = pthread_join( Task_id, NULL ); status = pthread_join( Task_id, NULL );
assert( !status ); assert( !status );
/* create a thread as SCHED_RR */ /* create a thread as SCHED_RR */
puts( "Init: create a thread of SCHED_RR with priority 120" ); puts( "Init: create a thread of SCHED_RR with priority 120" );
status = pthread_attr_init( &attr ); status = pthread_attr_init( &attr );
assert( !status ); assert( !status );
attr.schedpolicy = SCHED_RR; attr.schedpolicy = SCHED_RR;
attr.schedparam.sched_priority = 120; attr.schedparam.sched_priority = 120;
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( !status ); assert( !status );
puts( "Init: join with the other thread" ); puts( "Init: join with the other thread" );
status = pthread_join( Task_id, NULL ); status = pthread_join( Task_id, NULL );
assert( !status ); assert( !status );

View File

@@ -29,14 +29,14 @@ void diff_timespec(
) )
{ {
int nsecs_per_sec = 1000000000; int nsecs_per_sec = 1000000000;
result->tv_sec = stop->tv_sec - start->tv_sec; result->tv_sec = stop->tv_sec - start->tv_sec;
if ( stop->tv_nsec < start->tv_nsec ) { if ( stop->tv_nsec < start->tv_nsec ) {
result->tv_nsec = nsecs_per_sec - start->tv_nsec + stop->tv_nsec; result->tv_nsec = nsecs_per_sec - start->tv_nsec + stop->tv_nsec;
result->tv_sec--; result->tv_sec--;
} else } else
result->tv_nsec = stop->tv_nsec - start->tv_nsec; result->tv_nsec = stop->tv_nsec - start->tv_nsec;
} }
void *Task_1( void *Task_1(
@@ -51,7 +51,7 @@ void *Task_1(
status = clock_gettime( CLOCK_REALTIME, &start ); status = clock_gettime( CLOCK_REALTIME, &start );
assert( !status ); assert( !status );
status = sched_rr_get_interval( getpid(), &delay ); status = sched_rr_get_interval( getpid(), &delay );
assert( !status ); assert( !status );
@@ -63,8 +63,8 @@ void *Task_1(
delay.tv_nsec -= 1000000000; delay.tv_nsec -= 1000000000;
delay.tv_sec++; delay.tv_sec++;
} }
puts( "Task_1: killing time" ); puts( "Task_1: killing time" );
for ( ; ; ) { for ( ; ; ) {
@@ -78,10 +78,10 @@ void *Task_1(
if ( difference.tv_sec > delay.tv_sec ) if ( difference.tv_sec > delay.tv_sec )
break; break;
if ( difference.tv_nsec > delay.tv_nsec ) if ( difference.tv_nsec > delay.tv_nsec )
break; break;
} }
puts( "Task_1: exitting" ); puts( "Task_1: exitting" );

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
@@ -50,7 +50,7 @@ void *POSIX_Init(
Init_id = pthread_self(); Init_id = pthread_self();
printf( "Init's ID is 0x%08x\n", Init_id ); printf( "Init's ID is 0x%08x\n", Init_id );
/* invalid scheduling policy error */ /* invalid scheduling policy error */
puts( "Init: pthread_attr_init - SUCCESSFUL" ); puts( "Init: pthread_attr_init - SUCCESSFUL" );
@@ -79,7 +79,7 @@ void *POSIX_Init(
schedparam.ss_replenish_period.tv_nsec = 0; schedparam.ss_replenish_period.tv_nsec = 0;
schedparam.ss_initial_budget.tv_sec = 2; schedparam.ss_initial_budget.tv_sec = 2;
schedparam.ss_initial_budget.tv_nsec = 0; schedparam.ss_initial_budget.tv_nsec = 0;
schedparam.sched_priority = 200; schedparam.sched_priority = 200;
schedparam.ss_low_priority = 100; schedparam.ss_low_priority = 100;
@@ -88,7 +88,7 @@ void *POSIX_Init(
status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
assert( !status ); assert( !status );
puts( "Init: pthread_create - EINVAL (replenish < budget)" ); puts( "Init: pthread_create - EINVAL (replenish < budget)" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( status == EINVAL ); assert( status == EINVAL );
@@ -99,7 +99,7 @@ void *POSIX_Init(
schedparam.ss_replenish_period.tv_nsec = 0; schedparam.ss_replenish_period.tv_nsec = 0;
schedparam.ss_initial_budget.tv_sec = 1; schedparam.ss_initial_budget.tv_sec = 1;
schedparam.ss_initial_budget.tv_nsec = 0; schedparam.ss_initial_budget.tv_nsec = 0;
schedparam.sched_priority = 200; schedparam.sched_priority = 200;
schedparam.ss_low_priority = -1; schedparam.ss_low_priority = -1;
@@ -116,13 +116,13 @@ void *POSIX_Init(
schedparam.ss_replenish_period.tv_nsec = 0; schedparam.ss_replenish_period.tv_nsec = 0;
schedparam.ss_initial_budget.tv_sec = 1; schedparam.ss_initial_budget.tv_sec = 1;
schedparam.ss_initial_budget.tv_nsec = 0; schedparam.ss_initial_budget.tv_nsec = 0;
schedparam.sched_priority = 200; schedparam.sched_priority = 200;
schedparam.ss_low_priority = 100; schedparam.ss_low_priority = 100;
status = pthread_attr_setschedparam( &attr, &schedparam ); status = pthread_attr_setschedparam( &attr, &schedparam );
assert( !status ); assert( !status );
puts( "Init: pthread_create - SUCCESSFUL" ); puts( "Init: pthread_create - SUCCESSFUL" );
status = pthread_create( &Task_id, &attr, Task_1, NULL ); status = pthread_create( &Task_id, &attr, Task_1, NULL );
assert( !status ); assert( !status );

View File

@@ -1,4 +1,4 @@
/* /*
* Psx13 * Psx13
* Chris Bond (working under Jennifer's account) * Chris Bond (working under Jennifer's account)
* *
@@ -40,8 +40,8 @@
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
* InitFiles function * InitFiles function
* *
* Initializes the three files to be used in the test. * Initializes the three files to be used in the test.
* *
* arguments: none * arguments: none
* assumptions: fopen, fprintf, fwrite, FILE are available * assumptions: fopen, fprintf, fwrite, FILE are available
* actions: creates testfile1, a text file with 'a'..'z' listed 4 times. * actions: creates testfile1, a text file with 'a'..'z' listed 4 times.
@@ -49,7 +49,7 @@
* creates testfile3, a binary file with 0..9 listed 4 times. * creates testfile3, a binary file with 0..9 listed 4 times.
* returns: TRUE if files opened successfully. * returns: TRUE if files opened successfully.
* FALSE if fail on file open for write. * FALSE if fail on file open for write.
* *
* ------------------------------------------------------------------ * ------------------------------------------------------------------
*/ */
@@ -77,7 +77,7 @@ int InitFiles (void) {
if (letter > 'z') if (letter > 'z')
letter = 'a'; letter = 'a';
} }
number = 0; number = 0;
for (count = 0; count <40; ++count) { for (count = 0; count <40; ++count) {
@@ -96,7 +96,7 @@ int InitFiles (void) {
retval = TRUE; retval = TRUE;
} }
else else
retval = FALSE; retval = FALSE;
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
@@ -111,7 +111,7 @@ int InitFiles (void) {
* *
* arguments: none * arguments: none
* assumptions: lseek available * assumptions: lseek available
* actions: hits lseek with some dummy arguments. * actions: hits lseek with some dummy arguments.
* returns: value of return from lseek. * returns: value of return from lseek.
* *
* --------------------------------------------------------------- * ---------------------------------------------------------------
@@ -146,7 +146,7 @@ int DeviceLSeekTest (void) {
* actions: Gets a file descriptor(fd1) for test file1. * actions: Gets a file descriptor(fd1) for test file1.
* dups fd1 to fd2. * dups fd1 to fd2.
* sets fd1 to append mode * sets fd1 to append mode
* checks fd2 to ensure it's in append mode, also. * checks fd2 to ensure it's in append mode, also.
* returns: success if fd2 is indeed a copy of fd1. * returns: success if fd2 is indeed a copy of fd1.
* *
* --------------------------------------------------------------- * ---------------------------------------------------------------
@@ -169,7 +169,7 @@ int DupTest(void) {
close (fd1); close (fd1);
flags = (flags & O_APPEND); flags = (flags & O_APPEND);
retval = (flags == O_APPEND); retval = (flags == O_APPEND);
} }
@@ -192,7 +192,7 @@ int DupTest(void) {
* actions: Gets a file descriptor(fd1) for test file1. * actions: Gets a file descriptor(fd1) for test file1.
* dups fd1 to fd2. * dups fd1 to fd2.
* sets fd1 to append mode * sets fd1 to append mode
* checks fd2 to ensure it's in append mode, also. * checks fd2 to ensure it's in append mode, also.
* sets fd1 to invalid value, fd2 to valid, tries to dup2. * sets fd1 to invalid value, fd2 to valid, tries to dup2.
* sets fd2 to invalid value, fd1 to valid tries to dup2. * sets fd2 to invalid value, fd1 to valid tries to dup2.
* returns: success if fd2 is a copy of fd1, and invalid fd1 or fd2 produce errors. * returns: success if fd2 is a copy of fd1, and invalid fd1 or fd2 produce errors.
@@ -240,14 +240,14 @@ int Dup2Test(void) {
else { else {
fd1 = dup(fd2); fd1 = dup(fd2);
fd2 = -1; fd2 = -1;
if (dup2(fd1, fd2) != -1) if (dup2(fd1, fd2) != -1)
retval = FALSE; retval = FALSE;
} }
} }
close (fd1); close (fd1);
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
return (retval); return (retval);
@@ -276,9 +276,9 @@ int FDataSyncTest(void) {
int fd = -1; int fd = -1;
int error = 0, retval = TRUE; int error = 0, retval = TRUE;
/* Try it with a RD_ONLY file. */ /* Try it with a RD_ONLY file. */
fd = open ("testfile1.tst", O_RDONLY); fd = open ("testfile1.tst", O_RDONLY);
error = fdatasync(fd); error = fdatasync(fd);
@@ -286,7 +286,7 @@ int FDataSyncTest(void) {
retval = TRUE; retval = TRUE;
else else
retval = FALSE; retval = FALSE;
close (fd); close (fd);
if (retval == TRUE) { if (retval == TRUE) {
@@ -314,7 +314,7 @@ int FDataSyncTest(void) {
retval = FALSE; retval = FALSE;
close (fd); close (fd);
} }
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
@@ -359,7 +359,7 @@ int UMaskTest (void) {
/* --------------------------------------------------------------- /* ---------------------------------------------------------------
* UTimeTest function * UTimeTest function
* *
* Hits the utime code. Does NOT test the functionality of the underlying utime * Hits the utime code. Does NOT test the functionality of the underlying utime
* entry in the IMFS op table. * entry in the IMFS op table.
* *
* arguments: none * arguments: none
@@ -402,7 +402,7 @@ int UTimeTest (void) {
if ((fstat.st_atime == 12345) && (fstat.st_mtime == 54321 )) if ((fstat.st_atime == 12345) && (fstat.st_mtime == 54321 ))
retval = TRUE; retval = TRUE;
else else
retval = FALSE; retval = FALSE;
} }
@@ -435,7 +435,7 @@ int PipeTest (void) {
int error = 0, retval = FALSE; int error = 0, retval = FALSE;
int fd[2]; int fd[2];
error = pipe(fd); error = pipe(fd);
if ((error == -1) && (errno == ENOSYS)) if ((error == -1) && (errno == ENOSYS))
@@ -479,8 +479,8 @@ int PathConfTest (void) {
else else
retval = FALSE; retval = FALSE;
} }
else else
retval = FALSE; retval = FALSE;
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
@@ -498,7 +498,7 @@ int PathConfTest (void) {
* assumptions: fpathconf function available. * assumptions: fpathconf function available.
* actions: Call fpathconf with all arguments, plus an invalid. * actions: Call fpathconf with all arguments, plus an invalid.
* *
* returns: TRUE always. * returns: TRUE always.
* *
* --------------------------------------------------------------- * ---------------------------------------------------------------
*/ */
@@ -513,7 +513,7 @@ int FPathConfTest (void) {
if (error == -1) { if (error == -1) {
fd = open("testfile1.tst", O_RDWR); fd = open("testfile1.tst", O_RDWR);
error = fpathconf(fd, _PC_LINK_MAX); error = fpathconf(fd, _PC_LINK_MAX);
error = fpathconf(fd, _PC_MAX_CANON); error = fpathconf(fd, _PC_MAX_CANON);
error = fpathconf(fd, _PC_MAX_INPUT); error = fpathconf(fd, _PC_MAX_INPUT);
@@ -521,17 +521,17 @@ int FPathConfTest (void) {
error = fpathconf(fd, _PC_PATH_MAX); error = fpathconf(fd, _PC_PATH_MAX);
error = fpathconf(fd, _PC_PIPE_BUF); error = fpathconf(fd, _PC_PIPE_BUF);
error = fpathconf(fd, _PC_CHOWN_RESTRICTED); error = fpathconf(fd, _PC_CHOWN_RESTRICTED);
error = fpathconf(fd, _PC_NO_TRUNC); error = fpathconf(fd, _PC_NO_TRUNC);
error = fpathconf(fd, _PC_VDISABLE); error = fpathconf(fd, _PC_VDISABLE);
error = fpathconf(fd, _PC_ASYNC_IO); error = fpathconf(fd, _PC_ASYNC_IO);
error = fpathconf(fd, _PC_PRIO_IO); error = fpathconf(fd, _PC_PRIO_IO);
error = fpathconf(fd, _PC_SYNC_IO); error = fpathconf(fd, _PC_SYNC_IO);
error = fpathconf(fd, 255); error = fpathconf(fd, 255);
retval = TRUE; retval = TRUE;
} }
else else
retval = FALSE; retval = FALSE;
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
@@ -560,7 +560,7 @@ int FSyncTest (void) {
int error = 0, retval = FALSE; int error = 0, retval = FALSE;
int fd = -1; int fd = -1;
fd = open("testfile1.tst", O_RDWR); fd = open("testfile1.tst", O_RDWR);
if (fd != -1) { if (fd != -1) {
@@ -575,7 +575,7 @@ int FSyncTest (void) {
close(fd); close(fd);
} }
else else
retval = FALSE; retval = FALSE;
/* assert (retval == TRUE);*/ /* assert (retval == TRUE);*/
@@ -589,7 +589,7 @@ int FSyncTest (void) {
* *
* main entry point to the test * main entry point to the test
* *
* --------------------------------------------------------------- * ---------------------------------------------------------------
*/ */
#if defined(__rtems__) #if defined(__rtems__)
@@ -617,7 +617,7 @@ int main(
printf ("Success.\n"); printf ("Success.\n");
else else
printf ("Failed!!!\n"); printf ("Failed!!!\n");
printf ("Testing dup2()........... "); printf ("Testing dup2()........... ");
if (Dup2Test() == TRUE) if (Dup2Test() == TRUE)
printf ("Success.\n"); printf ("Success.\n");
@@ -659,7 +659,7 @@ int main(
printf ("Success.\n"); printf ("Success.\n");
else else
printf ("Failed!!!\n"); printf ("Failed!!!\n");
printf ("Testing fpathconf()...... "); printf ("Testing fpathconf()...... ");
if (FPathConfTest() == TRUE) if (FPathConfTest() == TRUE)
printf ("Success.\n"); printf ("Success.\n");

View File

@@ -1,6 +1,6 @@
/* /*
* Thread Test Program * Thread Test Program
* *
* - test of POSIX's pthread_init() function from rtemstask Init() * - test of POSIX's pthread_init() function from rtemstask Init()
* *
* ott@linux.thai.net * ott@linux.thai.net

View File

@@ -2,12 +2,12 @@
* This is a native test to explore how the readdir() family works. * This is a native test to explore how the readdir() family works.
* Newlib supports the following readdir() family members: * Newlib supports the following readdir() family members:
* *
* closedir() - * closedir() -
* readdir() - * readdir() -
* scandir() - * scandir() -
* opendir() - * opendir() -
* rewinddir() - * rewinddir() -
* telldir() - BSD not in POSIX * telldir() - BSD not in POSIX
* seekdir() - BSD not in POSIX * seekdir() - BSD not in POSIX
* *
* *
@@ -96,19 +96,19 @@ int main(
touch( "/one/one.test" ); touch( "/one/one.test" );
touch( "/one/two/two.test" ); touch( "/one/two/two.test" );
status = chroot( "/one" ); status = chroot( "/one" );
assert( status == 0 ); assert( status == 0 );
status = fileexists( "/one/one.test" ); status = fileexists( "/one/one.test" );
printf( "%s on /one/one.test\n", (!status) ? "SUCCESS" : "FAILURE" ); printf( "%s on /one/one.test\n", (!status) ? "SUCCESS" : "FAILURE" );
status = fileexists( "/two/two.test" ); status = fileexists( "/two/two.test" );
printf( "%s on /two/two.test\n", (status) ? "SUCCESS" : "FAILURE" ); printf( "%s on /two/two.test\n", (status) ? "SUCCESS" : "FAILURE" );
puts( "Reset the private environment" ); puts( "Reset the private environment" );
rtems_libio_set_private_env(); rtems_libio_set_private_env();
status = fileexists( "/one/one.test" ); status = fileexists( "/one/one.test" );
printf( "%s on /one/one.test\n", ( status) ? "SUCCESS" : "FAILURE" ); printf( "%s on /one/one.test\n", ( status) ? "SUCCESS" : "FAILURE" );

View File

@@ -438,7 +438,7 @@ int main(
while ( fgets(buffer, 128, file) ) while ( fgets(buffer, 128, file) )
printf( "%s", buffer ); printf( "%s", buffer );
/* /*
* Verify only atime changed for a read. * Verify only atime changed for a read.
*/ */
status = stat( "/tmp/j", &buf ); status = stat( "/tmp/j", &buf );
@@ -464,7 +464,7 @@ int main(
status = truncate( "/tmp/j", 40 ); status = truncate( "/tmp/j", 40 );
assert( !status ); assert( !status );
/* /*
* Verify truncate changed only atime. * Verify truncate changed only atime.
*/ */
status = stat( "/tmp/j", &buf ); status = stat( "/tmp/j", &buf );

View File

@@ -1,5 +1,5 @@
/* /*
* A test support function which performs a crude version of * A test support function which performs a crude version of
* "cat" so you can look at specific parts of a file. * "cat" so you can look at specific parts of a file.
* *
* $Id$ * $Id$

View File

@@ -1,5 +1,5 @@
/* /*
* A test support function which extends the file to the specified * A test support function which extends the file to the specified
* length. This handles the implied open(), lseek(), write(), and close() * length. This handles the implied open(), lseek(), write(), and close()
* operations. * operations.
* *

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_TIMERS #ifndef _POSIX_TIMERS
#error "rtems is supposed to have clock_gettime" #error "rtems is supposed to have clock_gettime"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_TIMERS #ifndef _POSIX_TIMERS
#error "rtems is supposed to have clock_settime" #error "rtems is supposed to have clock_settime"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_TIMERS #ifndef _POSIX_TIMERS
#error "rtems is supposed to have clock_getres" #error "rtems is supposed to have clock_getres"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_CPUTIME #ifndef _POSIX_CPUTIME
#error "rtems is supposed to have clock_getcpuclockid" #error "rtems is supposed to have clock_getcpuclockid"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_CPUTIME #ifndef _POSIX_CPUTIME
#error "rtems is supposed to have clock_setenable_attr" #error "rtems is supposed to have clock_setenable_attr"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <time.h> #include <time.h>
#ifndef _POSIX_CPUTIME #ifndef _POSIX_CPUTIME
#error "rtems is supposed to have clock_getenable_attr" #error "rtems is supposed to have clock_getenable_attr"
#endif #endif

View File

@@ -17,7 +17,7 @@
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_condattr_init" #error "rtems is supposed to have pthread_condattr_init"
#endif #endif
void test( void ) void test( void )
{ {
pthread_condattr_t attribute; pthread_condattr_t attribute;

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_condattr_destroy" #error "rtems is supposed to have pthread_condattr_destroy"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_init" #error "rtems is supposed to have pthread_cond_init"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_destroy" #error "rtems is supposed to have pthread_cond_destroy"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_signal" #error "rtems is supposed to have pthread_cond_signal"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_wait" #error "rtems is supposed to have pthread_cond_wait"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_timedwait" #error "rtems is supposed to have pthread_cond_timedwait"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_condattr_getpshared" #error "rtems is supposed to have pthread_condattr_getpshared"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_condattr_setpshared" #error "rtems is supposed to have pthread_condattr_setpshared"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_cond_broadcast" #error "rtems is supposed to have pthread_cond_broadcast"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_key_create" #error "rtems is supposed to have pthread_key_create"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_setspecific" #error "rtems is supposed to have pthread_setspecific"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_getspecific" #error "rtems is supposed to have pthread_getspecific"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_key_delete" #error "rtems is supposed to have pthread_key_delete"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutexattr_init" #error "rtems is supposed to have pthread_mutexattr_init"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutexattr_destroy" #error "rtems is supposed to have pthread_mutexattr_destroy"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_init" #error "rtems is supposed to have pthread_mutex_init"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_destroy" #error "rtems is supposed to have pthread_mutex_destroy"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_lock" #error "rtems is supposed to have pthread_mutex_lock"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_unlock" #error "rtems is supposed to have pthread_mutex_unlock"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutexattr_setprotocol" #error "rtems is supposed to have pthread_mutexattr_setprotocol"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutexattr_getprioceiling" #error "rtems is supposed to have pthread_mutexattr_getprioceiling"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutexattr_setprioceiling" #error "rtems is supposed to have pthread_mutexattr_setprioceiling"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutexattr_getpshared" #error "rtems is supposed to have pthread_mutexattr_getpshared"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutexattr_setpshared" #error "rtems is supposed to have pthread_mutexattr_setpshared"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_trylock" #error "rtems is supposed to have pthread_mutex_trylock"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_mutex_timedlock" #error "rtems is supposed to have pthread_mutex_timedlock"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutexattr_getprotocol" #error "rtems is supposed to have pthread_mutexattr_getprotocol"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutex_getprioceiling" #error "rtems is supposed to have pthread_mutex_getprioceiling"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREAD_PRIO_INHERIT #ifndef _POSIX_THREAD_PRIO_INHERIT
#error "rtems is supposed to have pthread_mutex_setprioceiling" #error "rtems is supposed to have pthread_mutex_setprioceiling"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
pid_t pid; pid_t pid;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
pid_t pid; pid_t pid;

View File

@@ -14,7 +14,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
uid_t uid; uid_t uid;

View File

@@ -14,7 +14,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
uid_t uid; uid_t uid;

View File

@@ -14,7 +14,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
gid_t gid; gid_t gid;

View File

@@ -14,7 +14,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
gid_t gid; gid_t gid;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
uid_t uid; uid_t uid;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
gid_t gid; gid_t gid;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
gid_t grouplist[ 20 ]; gid_t grouplist[ 20 ];

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
char *loginname; char *loginname;

View File

@@ -14,7 +14,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <limits.h> /* for LOGIN_NAME_MAX */ #include <limits.h> /* for LOGIN_NAME_MAX */
void test( void ) void test( void )
{ {
char loginnamebuffer[ LOGIN_NAME_MAX ]; char loginnamebuffer[ LOGIN_NAME_MAX ];

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
pid_t pgrp; pid_t pgrp;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
pid_t pid; pid_t pid;

View File

@@ -13,7 +13,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
void test( void ) void test( void )
{ {
pid_t pid = 0; pid_t pid = 0;

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_attr_init" #error "rtems is supposed to have pthread_attr_init"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_attr_setdetachstate" #error "rtems is supposed to have pthread_attr_setdetachstate"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_attr_getdetachstate" #error "rtems is supposed to have pthread_attr_getdetachstate"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_getstacksize" #error "rtems is supposed to have pthread_getstacksize"
#endif #endif

View File

@@ -13,7 +13,7 @@
*/ */
#include <pthread.h> #include <pthread.h>
#ifndef _POSIX_THREADS #ifndef _POSIX_THREADS
#error "rtems is supposed to have pthread_create" #error "rtems is supposed to have pthread_create"
#endif #endif

Some files were not shown because too many files have changed in this diff Show More