This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: shm status


"Christopher Faylor" <cgf@redhat.com> wrote:
> On Sun, Jun 09, 2002 at 02:21:22PM +0100, Conrad Scott wrote:
> >Also the ipcs and ipcrm utitilities are really useful when working with
sysv
> >ipc so I also thought I could start by adding these. Presumably this
would
> >be a case for another cygwin_internal() interface? i.e. get the list of
ids;
> >the program then issues xxxctl() calls to get the relevant details or rm
the
> >requested objects. Any objections to such an approach? (Just for
> >comparison, the usual Un*x implementation involves reading kernel
> >memory via /dev/kmem.)
>
> Do we need a cygwin_internal interface?  How do OSes like linux do this?
>
> Maybe it makes sense to start exposing things via the /proc interface, if
that
> is the way linux does it.

Umm . . . I was trying really hard to avoid going down that route but you're
probably right.

I was thinking of a simple interface that provided a list of current shmids
via the cygwin_internal interface (which would need to get them from the
cygserver AFAICT); the ipcs program would then use shmctl(2) to get
information on them. That way the current permission checking in shmctl(2)
would do most of the security work for me (i.e. getting a list of shmids is
not a security hole since you can't do anything with them unless you've got
access permission to them anyway).

I'll go and have a look at what linux does here. I've checked NetBSD et al.
and they use the tried and trusted /dev/kmem route (via kvm_openfiles() but
still . . .) and my memory of most of the commercial Un*xes I've used is
that they go the same route but that "knowledge" might be stale by now.

Cheers,

// Conrad




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]