[OT] C code

2008-05-25 Thread deoxy
Hello.

I dont know if this a cuestion for this list, but I think is it a valid 
cuestion...
I reading a book recomended in http://www.openbsd.org/books.html The book is 
Advanced programmig in the unix environment.
In this book I read Figure 3.1 but this not compile. the error is:

$cc F3_10.c
/tmp//ccnsuA79.o(.text+027): In function 'main':
:undefined reference to 'err_quit'
/tmp//ccnsuA79.o(.text+0x74): In fuction 'main':
:undefined reference to 'err_sys'
/tmp//ccnsuA79.o(.txt+0xdf): In functiion 'main':
:undefined reference to 'err_dump'
collect2: ld returned 1 exit status

The source is:


#include apue.h
#include fcntl.h

int
main(int argc, char *argv[])
{
int val;
if (argc != 2)
  err_quit(usage: a.out descriptor#);
if ((val = fcntl(atoi(argv[1]), F_GETFL, 0))  0)
  err_sys(fcntl error for fd %d, atoi(argv[1]));

switch (val  O_ACCMODE) {
case O_RDONLY:
printf(read only);
break;
case O_WRONLY:
printf(write only);
break;
case O_RDWR:
printf(read write);
break;
default:
err_dump(unknown access mode);
}
if (val  O_APPEND)
printf(, append);
if (val  O_NONBLOCK)
printf(, nonblocking);
#if  defined(O_SYNC)
if (val  O_SYNC)
printf(, synchronous writes);
#endif
putchar('\n');
exit(0);
}

I dont know wath is the problem. your can helpme?

Sorry my bad english.

regards.

Dmitri.-



Re: [OT] C code

2008-05-25 Thread deoxy
Hello.

apue.h is OK I take this of http://safari.oreilly.com/0201433079/app02
and this is in my folder.
The err_quit is in line 108 void err_quit(const char *, ...)i;
err_dump and err_sys are similar.

regards.

Dmitri.

On Mon, May 26, 2008 at 09:11:51AM +0530, Amarendra Godbole wrote:
  $cc F3_10.c
  /tmp//ccnsuA79.o(.text+027): In function 'main':
  :undefined reference to 'err_quit'
  /tmp//ccnsuA79.o(.text+0x74): In fuction 'main':
  :undefined reference to 'err_sys'
  /tmp//ccnsuA79.o(.txt+0xdf): In functiion 'main':
  :undefined reference to 'err_dump'
  collect2: ld returned 1 exit status
 
  The source is:
 
 
  #include apue.h
 
 This is the clue - where do you think is apue.h? Take a look at the
 last few pages of the book, and you will see.
 
 -Amarendra



Re: Window Manager

2008-05-23 Thread deoxy
blackbox, because is easy config
Regards.

Dmitri.-

On Thu, May 08, 2008 at 09:32:47PM +0200, Manuel Wildauer wrote:
 Fluxbox
 
 On Sun, May 04, 2008 at 09:29:42PM -0300, Gonzalo Lionel Rodriguez wrote:
  I dont know if it is the place to ask it, but that window manager uses? And
  why?
  
  Regards
 ---end quoted text---