libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] read.h needs unistd.h


From: Steven M. Schultz
Subject: Re: [Libcdio-devel] read.h needs unistd.h
Date: Thu, 19 Jan 2006 14:54:23 -0800 (PST)

On Thu, 19 Jan 2006, R. Bernstein wrote:

> I'd like to solicit comments on how to make sure off_t is defined in 
> cdio/read.h.
> 
> First, note that off_t comes from <sys/types> (not <unistd.h> per se).

        Hmmm, it seems that unistd.h also includes <sys/types.h>  .  If that

        But lseek() is in <unistd.h> so it's probably a good idea to include
        both <sys/types.h> and <unistd.h>.

> Approach 1 (Compression library): 
>   zlib.h uses z_offset_t and has which is defined in zconf.h as:
> 
> #  include <sys/types.h> /* for off_t */
> #  include <unistd.h>    /* for SEEK_* and off_t */

        Includes both of them - might be redundant but it's safe to do.

> Approach 2 (Samba client):
>   libsmbclient.h just has: 
>   #include <sys/types.h>

        That might be because modules in Samba that do seeking include
        unistd.h as required.

> Comments on which to use and/or why one or the other might be
> preferred? Or any other better approaches? 

        I think approach 1 might be better.  Modules which use off_t are
        likely to be calling lseek() and thus will need <unistd.h> for
        the lseek() prototype.

        Cheers,
        Steven Schultz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]