mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Someone Something <fordhaivat@gmail.com>
Cc: linux-kernel@vger.kernel.org, gregkh <greg@kroah.com>, corbet@lwn.net
Subject: Re: LDD examples
Date: Fri, 3 Sep 2010 11:01:58 -0700	[thread overview]
Message-ID: <20100903110158.aadf7850.rdunlap@xenotime.net> (raw)
In-Reply-To: <AANLkTim7eHwkbbOHdXax7dQiMzSAktxjNYBpQjKOwTUy@mail.gmail.com>

On Fri, 27 Aug 2010 18:32:03 -0400 Someone Something wrote:

> I downloaded the LDD examples
> (http://examples.oreilly.com/9780596005900/), and I unzipped the file
> and just tried building it with make just to see if it built properly
> and here are the errors I get:
> setlevel.c:30: error: expected declaration specifiers or '...' before 'type'
> setlevel.c:30: error: expected declaration specifiers or '...' before 'bufp'
> setlevel.c:30: error: expected declaration specifiers or '...' before 'len'
> setlevel.c:30: warning: data definition has no type or storage class
> setlevel.c:30: warning: type defaults to 'int' in declaration of '_syscall3'
> setlevel.c: In function 'main':
> setlevel.c:41: warning: implicit declaration of function 'syslog'
> 
> have any of use experienced these errors? Is this book out of date?
> Alternatives?
> --

The examples are certainly out of date.


'man 2 _syscall' says that it is obsolete and deprecated.

Fixing the userspace programs is easy.  E.g., for setlevel.c, just
#include <unistd.h> 
and change this line:

-_syscall3(int, syslog, int, type, char *, bufp, int, len);
+#define syslog(type, bufp, len)	syscall(8, type, bufp, len)


For the kernel modules, remove
#include <linux/config.h>
from all of them and change CFLAGS to EXTRA_CFLAGS in all Makefiles.

The biggest remaining problem with the kernel modules is scheduled_work
usage and its changing API.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2010-09-03 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 22:32 Someone Something
2010-09-03 18:01 ` Randy Dunlap [this message]
2010-09-04 17:44   ` Jonathan Corbet
2010-09-05 21:04     ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100903110158.aadf7850.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=corbet@lwn.net \
    --cc=fordhaivat@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®