LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-23-2006, 02:37 AM   #1
pat_and_cami
LQ Newbie
 
Registered: Feb 2006
Posts: 16

Rep: Reputation: 0
How do you call delay/udelay/mdelay timer in userspace?


I am trying to write a program which calls either udelay, mdelay or delay. I am getting the following errors trying to compile the program:
---
psullivan@linux:~> gcc delays.c
/tmp/ccmvwQPo.o(.text+0xf): In function `main':
delays.c: undefined reference to `delay'
/tmp/ccmvwQPo.o(.text+0x2d):delays.c: undefined reference to `mdelay'
/tmp/ccmvwQPo.o(.text+0x41):delays.c: undefined reference to `__bad_udelay'
collect2: ld returned 1 exit status
psullivan@linux:~>
---

I am trying to write using main() (does this mean I am writing in userspace?)? I am confused about this. Can I call exec() or fork() from my user space programs in my home directory simply using gcc (filename.c). Do I have to link in the kernel, or can the calls be made already since I am running in Konsole and compiling the program using gcc (as above)?

My program looks as follows:
---
psullivan@linux:~> cat delays.c
#include <stdio.h>
#include <string.h>
#include <asm/delay.h>

int main ()
{
delay(30);
printf ("Seeing Delay before Printing!!\n");
mdelay(4000);
printf("Next Print after delay!!\n");
udelay(5000000);
printf("Print last message after udelay!!!\n");
return 0;
}
psullivan@linux:~>
---


What am I doing wrong? Does anyone know?


Thanks,

Pat//
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link to reference linux timer calls? Undefined --bad_delay for udelay() pat_and_cami Programming 1 02-19-2006 06:30 PM
Call of duty sound delay jaksamarkotic Linux - Games 1 08-26-2005 03:46 AM
How to use udelay() in uclinux-2.4.x chandansingh Linux - Newbie 1 05-09-2005 06:48 AM
Userspace hosts file? ($HOSTFILE) tallest Linux - Software 2 02-01-2005 10:48 AM
Slackware AMD64 userspace joel112 Slackware 2 10-03-2004 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration