public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Re: Re: mount()/umount() prototypes
@ 2003-09-05 18:56 Savin Zlobec
  2003-09-06  0:32 ` [ECOS] " Nick Garnett
  0 siblings, 1 reply; 7+ messages in thread
From: Savin Zlobec @ 2003-09-05 18:56 UTC (permalink / raw)
  To: nickg; +Cc: ecos-discuss


Nick Garnett <nickg@ecoscentric.com> writes:

> 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.

That makes sense.

Since we are on the topic - I really miss flags field in (u)mount.
Especially to umount, when I need to do a forced umount (in case
the CF gets disconnected and then connected back again).
Both BSD and Linux have this (well in Linux you have umount2).

savin




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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re: mount()/umount() prototypes
  2003-09-05 18:56 [ECOS] Re: Re: mount()/umount() prototypes Savin Zlobec
@ 2003-09-06  0:32 ` Nick Garnett
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Garnett @ 2003-09-06  0:32 UTC (permalink / raw)
  To: Savin Zlobec; +Cc: ecos-discuss

Savin Zlobec <savin@torina.fe.uni-lj.si> writes:

> 
> Since we are on the topic - I really miss flags field in (u)mount.
> Especially to umount, when I need to do a forced umount (in case
> the CF gets disconnected and then connected back again).
> Both BSD and Linux have this (well in Linux you have umount2).

Given that these functions are not used extensively at present, and
there are relatively few calls to them, we probably have some
flexibility in re-defining them. Maybe we should add at least a flags
parameter to each, and maybe an additional data parameter to
mount(). This would bring then roughly in to line with the Linux
functions.

These extra parameters would also need to be propagated down into the
underlying filesystem calls.

If you would like to work up a patch to do this then I'm fairly sure
it would be accepted.

-- 
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re:  mount()/umount() prototypes
  2003-09-05 17:07     ` Nick Garnett
@ 2003-09-06  9:30       ` Savin Zlobec
  0 siblings, 0 replies; 7+ messages in thread
From: Savin Zlobec @ 2003-09-06  9:30 UTC (permalink / raw)
  To: Nick Garnett; +Cc: ecos-discuss

Nick Garnett <nickg@ecoscentric.com> writes:

>Given that these functions are not used extensively at present, and
>there are relatively few calls to them, we probably have some
>flexibility in re-defining them. Maybe we should add at least a flags
>parameter to each, and maybe an additional data parameter to
>mount(). This would bring then roughly in to line with the Linux
>functions.
>
>These extra parameters would also need to be propagated down into the
>underlying filesystem calls.
>
>If you would like to work up a patch to do this then I'm fairly sure
>it would be accepted.
>
Ok. I'll look into it.
I could add a cdl option - something like CYGIMP_IO_FILEIO_MOUNT_NEW_PROTO,
to switch between the old and new (u)mount prototypes - so that it would 
not break any code.

savin


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re:  mount()/umount() prototypes
  2003-09-05 14:00   ` Savin Zlobec
@ 2003-09-05 17:07     ` Nick Garnett
  2003-09-06  9:30       ` Savin Zlobec
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Garnett @ 2003-09-05 17:07 UTC (permalink / raw)
  To: Savin Zlobec; +Cc: Thomas Koeller, ecos-discuss

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re:  mount()/umount() prototypes
       [not found] ` <200309051529.01144.thomas.koeller@baslerweb.com>
@ 2003-09-05 14:00   ` Savin Zlobec
  2003-09-05 17:07     ` Nick Garnett
  0 siblings, 1 reply; 7+ messages in thread
From: Savin Zlobec @ 2003-09-05 14:00 UTC (permalink / raw)
  To: Thomas Koeller; +Cc: ecos-discuss

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.

savin



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re:  mount()/umount() prototypes
  2003-09-05 12:32 Savin Zlobec
@ 2003-09-05 13:31 ` Thomas Koeller
       [not found] ` <200309051529.01144.thomas.koeller@baslerweb.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Koeller @ 2003-09-05 13:31 UTC (permalink / raw)
  To: ecos-discuss

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.c

tk 
--------------------------------------------------

Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-162
Fax +49 (4102) 463-239

mailto:thomas.koeller@baslerweb.com
http://www.baslerweb.com

==============================


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re:  mount()/umount() prototypes
@ 2003-09-05 12:32 Savin Zlobec
  2003-09-05 13:31 ` Thomas Koeller
       [not found] ` <200309051529.01144.thomas.koeller@baslerweb.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Savin Zlobec @ 2003-09-05 12:32 UTC (permalink / raw)
  To: thomas.koeller; +Cc: ecos-discuss

>
>
>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


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-06  9:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-05 18:56 [ECOS] Re: Re: mount()/umount() prototypes Savin Zlobec
2003-09-06  0:32 ` [ECOS] " Nick Garnett
  -- strict thread matches above, loose matches on Subject: below --
2003-09-05 12:32 Savin Zlobec
2003-09-05 13:31 ` Thomas Koeller
     [not found] ` <200309051529.01144.thomas.koeller@baslerweb.com>
2003-09-05 14:00   ` Savin Zlobec
2003-09-05 17:07     ` Nick Garnett
2003-09-06  9:30       ` Savin Zlobec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).