×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi Michael,

On Fri, 2 Apr 2004 michaelr_41@xxxxxxxxxxxxxx wrote:
>
> D SetEUid         PR            10U 0 ExtProc('qsyseteuid')
> D   UID                         10U 0 Const

This prototype has two major problems:

1) the return value for seteuid is "int", yet you have it prototype as
"unsigned."  That's a minor problem, though -- the only problem it'll
cause is that errors will return 4294967295 instead of -1.  You can fix
that problem by making the return value "10I 0"

2) The UID parameter is supposed to be passed by VALUE.   This is a big
problem -- the procedure is expecting to receive an integer, and you're
sending it a pointer instead.

The only reason that this API would work the way you've got it prototyped
is if the 4 bytes of the address of the variable that you pass happens to
be the same value as is stored in the variable.   That will happen quite
often with a value of zero, but I bet it won't happen with work with any
other value.

The fix is to remove "CONST" and add "VALUE" in it's place.


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.