Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Dec 2001 00:39:25 +0100
From:      Bernd Walter <ticso@cicely9.cicely.de>
To:        Warner Losh <imp@harmony.village.org>
Cc:        Erik Trulsson <ertr1013@student.uu.se>, Steve Price <steve@FreeBSD.ORG>, Andreas Klemm <andreas@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: ports/print/apsfilter Makefile ports/print/apsfilter/files patch-bin::aps2file ports/print/apsfilter/scripts pre-configure
Message-ID:  <20011217233925.GB18149@cicely9.cicely.de>
In-Reply-To: <200112172140.fBHLeDM79393@harmony.village.org>
References:  <20011217201850.A21347@student.uu.se> <200112171847.fBHIlbP69769@freefall.freebsd.org> <20011217130555.J72144@bsd.havk.org> <200112172140.fBHLeDM79393@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 17, 2001 at 02:40:13PM -0700, Warner Losh wrote:
> In message <20011217201850.A21347@student.uu.se> Erik Trulsson writes:
> : If you use tcsh or zsh (or presumably bash but I haven't tried that) this
> : will indeed output "hello" to stdout.
> : If you use /bin/sh it will instead complain that it cannot create
> : /dev/stdout.
> : 
> : This is probably a bug in /bin/sh
> 
> csh works.  But sh says:
> $ echo hello > /dev/stdout
> cannot create /dev/stdout: permission denied
> $ ls -l /dev/stdout
> crw-rw-rw-  1 root  wheel   22,   1 Jun 18  2001 /dev/stdout

Here is the ktrace Part:
[...]
 60779 sh       RET   sigaction 0
 60779 sh       CALL  __getcwd(0xbfbff824,0x100)
 60779 sh       RET   __getcwd 0
 60779 sh       CALL  fcntl(0x1,0,0xa)
 60779 sh       RET   fcntl 10/0xa
 60779 sh       CALL  close(0x1)
 60779 sh       RET   close 0
 60779 sh       CALL  open(0x80ecf14,0x601,0x1b6)
 60779 sh       NAMI  "/dev/stdout"
 60779 sh       RET   open -1 errno 13 Permission denied
 60779 sh       CALL  break(0x80f5000)
 60779 sh       RET   break 0
 60779 sh       CALL  write(0x2,0x80f4000,0x2d)
 60779 sh       GIO   fd 2 wrote 45 bytes
       "cannot create /dev/stdout: permission denied
       "
 60779 sh       RET   write 45/0x2d
 60779 sh       CALL  exit(0x2)

Flags to open are O_WRONLY | O_CREAT | O_TRUNC.

With >> it's 0x209 = O_WRONLY | O_CREAT | O_APPEND.

-- 
B.Walter              COSMO-Project         http://www.cosmo-project.de
ticso@cicely.de         Usergroup           info@cosmo-project.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011217233925.GB18149>