Bug 25436

Summary: csh builtin nice behaves improperly
Product: Base System Reporter: Robert Watson <rwatson>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description Robert Watson freebsd_committer freebsd_triage 2001-02-27 22:40:01 UTC
First off, the csh "nice" command has a different syntax than nice(1),
as it uses a "+prio" instead of "prio" interface.  This is probably
acceptable as it is documented that way in the csh man page, as confusing
as users may find that.

However, what does worry me is that the csh nice command doesn't appear to
work properly, and report errors correctly.

How-To-Repeat: 
(using tcsh as shell)
sproing:~> nice -10 cat /dev/sndstat
FreeBSD Audio Driver (newpcm) Feb 27 2001 15:39:57
Installed devices:
pcm1: <CS423x> at io 0x534 irq 5 drq 1:0 (1p/1r channels duplex)
sproing:~> nice +10 cat /dev/sndstat
FreeBSD Audio Driver (newpcm) Feb 27 2001 15:39:57
Installed devices:
pcm1: <CS423x> at io 0x534 irq 5 drq 1:0 (1p/1r channels duplex)
sproing:~> /usr/bin/nice -10 cat /dev/sndstat
FreeBSD Audio Driver (newpcm) Feb 27 2001 15:39:57
Installed devices:
pcm1: <CS423x> at io 0x534 irq 5 drq 1:0 (1p/1r channels duplex)
sproing:~> /usr/bin/nice --10 cat /dev/sndstat
nice: setpriority: Permission denied

I.e., the csh built-in nice failed to report the failure of the "nice -10"
to set a low nice level.  Maybe this is a feature...?
Comment 1 dima 2001-02-28 04:10:44 UTC
> 
> >Number:         25436
> >Category:       bin
> >Synopsis:       csh builtin nice behaves improperly
> 
> However, what does worry me is that the csh nice command doesn't appear to
> work properly, and report errors correctly.

It works, it just doesn't report errors; it throws away the return
value from setpriority(2).  I can send patches for this, but that
would mean taking off three or four files off the vendor branch.  Is
tcsh actively maintained?  If so, where should patches be submitted
to?  Anyone?

Regards

					Dima Dorfman
					dima@unixfreak.org
Comment 2 dima 2001-03-15 05:48:17 UTC
> [ csh builtin nice doesn't check return value of setpriority(2) ]

This has been fixed in the tcsh repository by Christos Zoulas.
FreeBSD will pick up the change the next time tcsh is imported.  Do
you want to keep this PR open until then, or should I close it?

Thanks

					Dima Dorfman
					dima@unixfreak.org
Comment 3 Robert Watson freebsd_committer freebsd_triage 2001-03-15 12:39:58 UTC
Closing it is fine, thanks!



Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services

On Wed, 14 Mar 2001, Dima Dorfman wrote:

> > [ csh builtin nice doesn't check return value of setpriority(2) ]
> 
> This has been fixed in the tcsh repository by Christos Zoulas.
> FreeBSD will pick up the change the next time tcsh is imported.  Do
> you want to keep this PR open until then, or should I close it?
> 
> Thanks
> 
> 					Dima Dorfman
> 					dima@unixfreak.org
> 
>
Comment 4 dd freebsd_committer freebsd_triage 2001-03-16 00:01:19 UTC
State Changed
From-To: open->closed

Fixed in the tcsh repo; FreeBSD will pick it up with the next update.