[ECOS] Re: mount()/umount() prototypes

Nick Garnett nickg@ecoscentric.com
Fri Sep 5 17:07:00 GMT 2003


Savin Zlobec <savin@elatec.si> writes:

> Thomas Koeller wrote:
> 
> >Savin Zlobec wrote:
> >
> >>>Hi,
> >>>
> >>>there appears to be no header file that implements prototypes for mount()
> >>>and umount(). When I build for the linux synthetic target and have
> >>>'#include <sys/mount.h>' in my program, everything works because
> >>>'-nostdinc' is not among the compiler switches by default. However, if I
> >>>compile for my real target then there is no such header, and after I
> >>>remove the '#include', I get warnings about implicit declarations.
> >>>
> >>Look in 'io/fileio/current/include/fileio.h'
> >>
> >>savin
> >>
> >
> >I see. Because there are 'standard' functions, I expected them to be in some
> >standard header. Btw., there are source files that include sys/mount.h, as
> >demonstrated below:
> >
> >bash-2.05b$ find /pub/ecos/cvs/packages/ -type f -name "*.c" -exec grep -l '#include <sys/mount.h>' '{}' \;
> >
> >/pub/ecos/cvs/packages/net/tcpip/current/src/sys/kern/sys_generic.c
> >/pub/ecos/cvs/packages/net/tcpip/current/src/sys/kern/uipc_syscalls.
> >
> Look closer - it is included if __ECOS is NOT defined.
> 
> #ifndef __ECOS              #include <sys/mount.h>
> #endif // __ECOS
> 
> But I agree with you some standard headers would be nice.

Except that they are not actually standard functions. mount() and
umount() tend to differ between different breeds of UNIX, Linux is
different from BSD for example. They are also not part of any standard
such as POSIX.

The problem is that how you get a filesystem mounted is a very
OS-specific thing. In eCos these functions support only the eCos way
of doing it. Hence having the prototypes in an eCos-specific header is
a good way of reminding the user that he is being non-portable when
using them.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list