[pacman-dev] Checking free space before transaction

Nezmer git at nezmer.info
Fri Nov 12 03:22:35 CET 2010


On Fri, Nov 12, 2010 at 11:07:14AM +1000, Allan McRae wrote:
> So, looking into this further:
> 
> getmntent:
>    used by glibc, uclibc, cygwin
> 
> getmntinfo with statfs:
>    used by bsd4.4  (FreeBSD, OpenBSD, OSX)
> 
> getmntinfo with statvfs:
>    NetBSD
> 
> I can work with that...  the mount point struct can hold a statfs or
> statvfs object depending on what function we are using. Given the
> entries that we need to access are available in both structs, the
> rest should be transparent.
> 
> So what I need to do is:
> 1) figure out how to distinguish between the two getmntinfo versions...

Wouldn't this work?:

#ifndef __NetBSD__
/* use statfs */
#else
/* use statvfs */
#endif


> 2) add a code path for the second getmntinfo
> 3) review what headers need included in each path
> 
> I could do with some help figuring out #1 as that is hitting the
> limits of my autoconf knowledge.  Any ideas?
> 
> Allan
> 


More information about the pacman-dev mailing list