[OpenAFS] OpenAFS on OpenBSD-current (ELF)

Brent Graveland brent@graveland.net
Mon, 23 Jun 2003 12:12:53 -0400


Jim Rees wrote:
> I don't think it's a good idea to add the missing string functions back into
> the kernel.
> 
> Please try this patch to your patch.  If it works I'll commit it.
> 
>  #define afs_strcasecmp(s1, s2)	strncasecmp((s1), (s2), 65535)
> +#ifdef AFS_OBSD34_ENV
> +#define strcpy(s1, s2)		strncpy((s1), (s2), 65535)
> +#else
>  #define afs_strcat(s1, s2)	strcat((s1), (s2))
> +#endif

I didn't like the idea either, but this is equivilent, no?  You don't 
gain any of the benifits of the 'n' functions if you just hardcode the 
lengths. The only benifit to this I see is that you don't have to 
recompile the kernel. strcat is also an issue, would you not need

#define strcat(s1, s2)	strncat((s1), (s2), 65535)

to make this work as well?

I don't suppose there are any plans on getting rid of strcpy and strcat 
in afs?  If I manage the time (going to be moving soon) I may start 
whacking away at these functions in afs and submitting patches. I just 
seems "wrong" to alias str{cat,cpy} to the 'n' functions.

-- 
Brent Graveland
brent@graveland.net