LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2006, 10:01 PM   #1
BradDaBug
LQ Newbie
 
Registered: May 2002
Posts: 29

Rep: Reputation: 15
Asynchronous file I/O


I'm trying to get started with AIO, but I'm having trouble. Whenever I include linux/aio.h I get all sorts of compiler errors, mostly involving incomplete and undeclared types inside the headers that aio.h includes.

Am I doing something wrong?
 
Old 03-18-2006, 10:32 PM   #2
pankaj99
Member
 
Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 47

Rep: Reputation: 15
may be you have not included some other headers nedded as well.
posting the error messages might help us to know more.
 
Old 03-18-2006, 10:42 PM   #3
BradDaBug
LQ Newbie
 
Registered: May 2002
Posts: 29

Original Poster
Rep: Reputation: 15
This is the errors I get:

Code:
In file included from /usr/include/linux/workqueue.h:8,
                 from /usr/include/linux/aio.h:5,
                 from ../include/filesystem/aio_helper.h:5,
                 from ../include/filesystem/filesystem.h:9,
                 from filesystem/filesystem.cpp:1:
/usr/include/linux/timer.h:12: error: field `entry' has incomplete type
/usr/include/linux/timer.h:35: error: syntax error before `(' token
/usr/include/linux/timer.h: In function `int timer_pending(const timer_list*)':
/usr/include/linux/timer.h:49: error: 'const struct timer_list' has no member
   named 'entry'
In file included from /usr/include/linux/aio.h:5,
                 from ../include/filesystem/aio_helper.h:5,
                 from ../include/filesystem/filesystem.h:9,
                 from filesystem/filesystem.cpp:1:
/usr/include/linux/workqueue.h: At global scope:
/usr/include/linux/workqueue.h:16: error: field `entry' has incomplete type
In file included from /usr/include/asm/system.h:8,
                 from /usr/include/asm-i486/processor.h:18,
                 from /usr/include/asm/processor.h:8,
                 from /usr/include/asm-i486/atomic.h:6,
                 from /usr/include/asm/atomic.h:8,
                 from /usr/include/linux/aio.h:8,
                 from ../include/filesystem/aio_helper.h:5,
                 from ../include/filesystem/filesystem.h:9,
                 from filesystem/filesystem.cpp:1:
/usr/include/asm-i486/system.h:247: error: syntax error before `new'
/usr/include/asm-i486/system.h: In function `long unsigned int __cmpxchg(...)':
/usr/include/asm-i486/system.h:250: error: `size' undeclared (first use this
   function)
/usr/include/asm-i486/system.h:250: error: (Each undeclared identifier is
   reported only once for each function it appears in.)
/usr/include/asm-i486/system.h:254: error: syntax error before `)' token
/usr/include/asm-i486/system.h:260: error: syntax error before `)' token
/usr/include/asm-i486/system.h:266: error: syntax error before `)' token
/usr/include/asm-i486/system.h:270: error: `old' undeclared (first use this
   function)
In file included from /usr/include/asm/processor.h:8,
                 from /usr/include/asm-i486/atomic.h:6,
                 from /usr/include/asm/atomic.h:8,
                 from /usr/include/linux/aio.h:8,
                 from ../include/filesystem/aio_helper.h:5,
                 from ../include/filesystem/filesystem.h:9,
                 from filesystem/filesystem.cpp:1:
/usr/include/asm-i486/processor.h: In function `void load_esp0(tss_struct*,
   thread_struct*)':
/usr/include/asm-i486/processor.h:486: error: `unlikely' undeclared (first use
   this function)
In file included from ../include/filesystem/aio_helper.h:5,
                 from ../include/filesystem/filesystem.h:9,
                 from filesystem/filesystem.cpp:1:
/usr/include/linux/aio.h: At global scope:
/usr/include/linux/aio.h:47: error: field `ki_run_list' has incomplete type
/usr/include/linux/aio.h:58: error: field `ki_list' has incomplete type
/usr/include/linux/aio.h:72: error: 'wait_queue_t' is used as a type, but is
   not defined as a type.
/usr/include/linux/aio.h:77: error: syntax error before `private'
/usr/include/linux/aio.h:139: error: syntax error before `;' token
/usr/include/linux/aio.h:144: error: field `active_reqs' has incomplete type
/usr/include/linux/aio.h:145: error: field `run_list' has incomplete type
/usr/include/linux/aio.h: In function `kiocb* list_kiocb(list_head*)':
/usr/include/linux/aio.h:194: error: syntax error before `,' token
/usr/include/linux/aio.h:194: error: `ki_list' undeclared (first use this
   function)
/usr/include/linux/aio.h:194: error: `list_entry' undeclared (first use this
   function)
 
Old 03-18-2006, 11:17 PM   #4
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
source code helps. Then we can help you debug it
 
Old 03-19-2006, 01:00 AM   #5
BradDaBug
LQ Newbie
 
Registered: May 2002
Posts: 29

Original Poster
Rep: Reputation: 15
Here's the entire contents of the file that includes the header:
Code:
#ifndef AIO_HELPER
#define AIO_HELPER

#if defined linux
#	include <linux/aio.h>
#endif

namespace FileSystem
{
#if defined linux
	// linux version of the class
	class AIOHelper
	{
	public:
		
	};
#endif
	
};

#endif // AIO_HELPER
There's not much there. Even if I create a blank .cpp file that looks like this:
Code:
#include <linux/aio.h>

int main()
{
	return 0;
}
then I get the same errors.
 
Old 03-19-2006, 05:11 PM   #6
BradDaBug
LQ Newbie
 
Registered: May 2002
Posts: 29

Original Poster
Rep: Reputation: 15
Hmm, if I do #include <aio.h> instead of #include <linux/aio.h> then it compiles.
 
  


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
LXer: Make asynchronous requests with JavaScript and Ajax LXer Syndicated Linux News 0 01-22-2006 04:31 AM
Programming asynchronous I/O in Linux with C iuaui Programming 2 09-30-2005 05:01 PM
running asynchronous jobs Raptor Ramjet Linux - General 3 12-01-2004 02:49 AM
Problem with asynchronous notification rajesh_b Programming 2 09-17-2004 07:58 AM
Synchronous vs Asynchronous Transfers WeNdeL Linux - Hardware 0 10-22-2003 03:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:47 AM.

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