Changed type of ni_dirp in struct namei' from caddr_t to const char *'

so that the compiler can see that it is OK to use const strings in
NDINIT().  Some emulators want to use paths of the form "/compat/foo".
Removed the casts that hid the non-problem.  Didn't fix the missing
consts in syscalls.master that hid the non-problem.
This commit is contained in:
Bruce Evans 1996-09-03 23:17:15 +00:00
parent e7fa2650cc
commit 6bce784d06
4 changed files with 10 additions and 13 deletions

View File

@ -27,7 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp
* $Id: linux_util.c,v 1.1 1996/03/02 19:38:02 peter Exp $
* $Id: linux_util.c,v 1.2 1996/08/05 20:52:30 nate Exp $
*/
#include <sys/param.h>
@ -134,9 +134,8 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag)
* root directory and never finding it, because "/" resolves
* to the emulation root directory. This is expensive :-(
*/
/* XXX: prototype should have const here for NDINIT */
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE,
(char *) linux_emul_path, p);
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path,
p);
if ((error = namei(&ndroot)) != 0) {
/* Cannot happen! */

View File

@ -133,9 +133,8 @@ ibcs2_emul_find(p, sgp, prefix, path, pbuf, cflag)
* root directory and never finding it, because "/" resolves
* to the emulation root directory. This is expensive :-(
*/
/* XXX: prototype should have const here for NDINIT */
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE,
(char *) ibcs2_emul_path, p);
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, ibcs2_emul_path,
p);
if ((error = namei(&ndroot)) != 0) {
/* Cannot happen! */

View File

@ -27,7 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp
* $Id: linux_util.c,v 1.1 1996/03/02 19:38:02 peter Exp $
* $Id: linux_util.c,v 1.2 1996/08/05 20:52:30 nate Exp $
*/
#include <sys/param.h>
@ -134,9 +134,8 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag)
* root directory and never finding it, because "/" resolves
* to the emulation root directory. This is expensive :-(
*/
/* XXX: prototype should have const here for NDINIT */
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE,
(char *) linux_emul_path, p);
NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path,
p);
if ((error = namei(&ndroot)) != 0) {
/* Cannot happen! */

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)namei.h 8.5 (Berkeley) 1/9/95
* $Id: namei.h,v 1.10 1996/02/26 18:40:44 hsu Exp $
* $Id: namei.h,v 1.10 1996/03/11 02:25:04 hsu Exp $
*/
#ifndef _SYS_NAMEI_H_
@ -46,7 +46,7 @@ struct nameidata {
/*
* Arguments to namei/lookup.
*/
caddr_t ni_dirp; /* pathname pointer */
const char *ni_dirp; /* pathname pointer */
enum uio_seg ni_segflg; /* location of pathname */
/* u_long ni_nameiop; namei operation */
/* u_long ni_flags; flags to namei */