Bug 73778 - [patch] linux emulation: semctl(IPC_STAT) has broken return value
Summary: [patch] linux emulation: semctl(IPC_STAT) has broken return value
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.2.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-10 16:50 UTC by Andriy Gapon
Modified: 2005-02-11 13:47 UTC (History)
0 users

See Also:


Attachments
ipc.patch (588 bytes, patch)
2004-11-10 16:50 UTC, Andriy Gapon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon 2004-11-10 16:50:28 UTC
semctl with IPC_STAT command should return zero in case of success, see:
semctl(2)
http://www.opengroup.org/onlinepubs/009695399/functions/semctl.html

because of a bug in linux_semctl() a positive value is returned:
td_retval is assigned a value for both LINUX_IPC_STAT and LINUX_SEM_STAT

this breaks some linux applications with error check "semctl() != 0",
while applications with error check "semctl() < 0" remain happy.
among affected applications is IBM MQ / WEMPS.

Fix: apply the following patch
	
How-To-Repeat: write a small test program or just look at the code
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2004-11-29 09:18:21 UTC
Responsible Changed
From-To: freebsd-bugs->emulation

Reassign to appropriate mailing list.
Comment 2 Maxim Sobolev freebsd_committer freebsd_triage 2005-02-11 13:47:30 UTC
State Changed
From-To: open->closed

Fix comitted, thank you for reporting!