Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Jason Mancini <jmancini@pa.dec.com>
Subject: Re: dunix/cxx/mknod
Date: 1998/08/25	[thread overview]
Message-ID: <35E335FE.680EC65B@pa.dec.com> (raw)
In-Reply-To: 6rvbps$r30$1@infosun2.rus.uni-stuttgart.de

Stefan Schwarzer wrote:
(snip)
 > You are hiding the c-library function by your repeated declaration of
 > mknod before the main. At least you should use an extern "C" {} if
you
 > require such a hack for some reason. The c++ compiler will then not
 > mangle the types into the function name and give the linker a chance
to
 > find the function name in the c-library...
 > btw: the c compiler warns because the signature is not ok,
 > the second argument is mode_t which is a typedef from unsigned int.
 > 
 > The following works fine for me:
 > 
 > 23:43 margay_sts:~> cat mknod.cc
 > #include <sys/stat.h>
 > int main(){
 >   mknod("foo", S_IFIFO |0666, 0);
 > }
 > 23:43 margay_sts:~> cxx -D_XOPEN_SOURCE_EXTENDED mknod.cc
 > 23:44 margay_sts:~> a.out
 > 23:44 margay_sts:~> ls -l foo
 > prw-r--r--   1 sts      cron           0 Aug 25 23:44 foo|
 > 
 > --
 > Stefan Schwarzer                office:  +49-(0)711-685-7606   fax:
x-3658
 > 70569 Stuttgart, Germany            
http://www.ica1.uni-stuttgart.de/~sts

(I could swear that I tried that combo...)
Thanks, I got it working in minutes!
I see my error now.  Thanks again,
/Jason



      reply	other threads:[~1998-08-25  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35E2007A.A7767FA1@pa.dec.com>
     [not found] ` <35E27DA1.A926226E@zko.dec.com>
1998-08-25  4:00   ` dunix/cxx/mknod Jason Mancini
1998-08-25  4:00     ` dunix/cxx/mknod Stefan Schwarzer
1998-08-25  4:00       ` Jason Mancini [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox