- u.u_error = rdwri(UIO_WRITE, ip,
- (caddr_t)&u, ctob(UPAGES),
- 0, 1, (int *)0);
- if (u.u_error == 0)
- u.u_error = rdwri(UIO_WRITE, ip,
- (caddr_t)ctob(u.u_tsize), ctob(u.u_dsize),
- ctob(UPAGES), 0, (int *)0);
- if (u.u_error == 0)
- u.u_error = rdwri(UIO_WRITE, ip,
- (caddr_t)(USRSTACK-ctob(u.u_ssize)), ctob(u.u_ssize),
- ctob(UPAGES)+ctob(u.u_dsize), 0, (int *)0);
+ error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&u, ctob(UPAGES), (off_t)0,
+ UIO_SYSSPACE, IO_UNIT, ndp->ni_cred, (int *)0);
+ if (error == 0)
+ error = vn_rdwr(UIO_WRITE, vp,
+ (caddr_t)ctob(dptov(u.u_procp, 0)),
+ (int)ctob(u.u_dsize), (off_t)ctob(UPAGES),
+ UIO_USERSPACE, IO_UNIT, ndp->ni_cred, (int *)0);
+ if (error == 0)
+ error = vn_rdwr(UIO_WRITE, vp,
+ (caddr_t)ctob(sptov(u.u_procp, u.u_ssize - 1)),
+ (int)ctob(u.u_ssize),
+ (off_t)ctob(UPAGES) + ctob(u.u_dsize),
+ UIO_USERSPACE, IO_UNIT, ndp->ni_cred, (int *)0);