Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
8a66212a
Commit
8a66212a
authored
16 years ago
by
patacongo
Browse files
Options
Downloads
Patches
Plain Diff
cosmetic
git-svn-id:
svn://svn.code.sf.net/p/nuttx/code/trunk@1494
42af7a65-404d-4744-a932-0658087f49c3
parent
364e4ac1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sched/sleep.c
+28
-28
28 additions, 28 deletions
sched/sleep.c
sched/usleep.c
+24
-24
24 additions, 24 deletions
sched/usleep.c
with
52 additions
and
52 deletions
sched/sleep.c
+
28
−
28
View file @
8a66212a
/************************************************************
* sleep.c
/************************************************************
****************
*
sched/
sleep.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007
, 2009
Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name
Gregory
Nutt nor the names of its contributors may be
* 3. Neither the name Nutt
X
nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
...
...
@@ -31,57 +31,57 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Included Files
************************************************************/
************************************************************
****************
/
#include
<sys/types.h>
#include
<unistd.h>
#include
<signal.h>
/************************************************************
* Definitions
************************************************************/
/************************************************************
****************
*
Preprocessor
Definitions
************************************************************
****************
/
/************************************************************
* Private Type De
clara
tions
************************************************************/
/************************************************************
****************
* Private Type De
fini
tions
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Global Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Function Prototypes
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Public Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Function: sleep
*
* Description:
* As typically declared in unistd.h. sleep() is a simple
*
application of
sigtimedwait.
* As typically declared in unistd.h. sleep() is a simple
application of
* sigtimedwait.
*
* Parameters:
* seconds
*
* Returned Value:
* Zero if the requested time has elapsed, or the number
*
of seconds left
to sleep.
* Zero if the requested time has elapsed, or the number
of seconds left
* to sleep.
*
* Assumptions:
*
************************************************************/
************************************************************
****************
/
unsigned
int
sleep
(
unsigned
int
seconds
)
{
...
...
@@ -95,7 +95,7 @@ unsigned int sleep(unsigned int seconds)
ts
.
tv_sec
=
seconds
;
ts
.
tv_nsec
=
0
;
(
void
)
sigtimedwait
(
&
set
,
&
value
,
&
ts
);
}
}
return
0
;
}
This diff is collapsed.
Click to expand it.
sched/usleep.c
+
24
−
24
View file @
8a66212a
/************************************************************
* usleep.c
/************************************************************
****************
*
sched/
usleep.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007
, 2009
Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
...
...
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name
Gregory
Nutt nor the names of its contributors may be
* 3. Neither the name Nutt
X
nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
...
...
@@ -31,46 +31,46 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Included Files
************************************************************/
************************************************************
****************
/
#include
<sys/types.h>
#include
<unistd.h>
#include
<signal.h>
/************************************************************
/************************************************************
****************
* Definitions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Type Declarations
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Global Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Variables
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Private Function Prototypes
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Public Functions
************************************************************/
************************************************************
****************
/
/************************************************************
/************************************************************
****************
* Function: usleep
*
* Description:
* BSD version as typically declared in unistd.h.
s
uleep()
*
is a simple
application of sigtimedwait.
* BSD version as typically declared in unistd.h. u
s
leep()
is a simple
* application of sigtimedwait.
*
* Parameters:
* seconds
...
...
@@ -80,7 +80,7 @@
*
* Assumptions:
*
************************************************************/
************************************************************
****************
/
void
usleep
(
unsigned
long
usec
)
{
...
...
@@ -94,5 +94,5 @@ void usleep(unsigned long usec)
ts
.
tv_sec
=
usec
/
1000000
;
ts
.
tv_nsec
=
(
usec
%
1000000
)
*
1000
;
(
void
)
sigtimedwait
(
&
set
,
&
value
,
&
ts
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment