summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_aout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/link_aout.c')
-rw-r--r--sys/kern/link_aout.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c
index 1218e22..e410b20 100644
--- a/sys/kern/link_aout.c
+++ b/sys/kern/link_aout.c
@@ -193,14 +193,15 @@ static int
link_aout_load_file(linker_class_t lc, const char* filename, linker_file_t* result)
{
struct nameidata nd;
- struct proc* p = curproc; /* XXX */
+ struct thread *td = curthread; /* XXX */
+ struct proc *p = td->td_proc;
int error = 0;
int resid, flags;
struct exec header;
aout_file_t af;
linker_file_t lf = 0;
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td);
flags = FREAD;
error = vn_open(&nd, &flags, 0);
if (error)
@@ -211,7 +212,7 @@ link_aout_load_file(linker_class_t lc, const char* filename, linker_file_t* resu
* Read the a.out header from the file.
*/
error = vn_rdwr(UIO_READ, nd.ni_vp, (void*) &header, sizeof header, 0,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
+ UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
if (error)
goto out;
@@ -236,7 +237,7 @@ link_aout_load_file(linker_class_t lc, const char* filename, linker_file_t* resu
*/
error = vn_rdwr(UIO_READ, nd.ni_vp, (void*) af->address,
header.a_text + header.a_data, 0,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
+ UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, td);
if (error)
goto out;
bzero(af->address + header.a_text + header.a_data, header.a_bss);
@@ -267,8 +268,8 @@ link_aout_load_file(linker_class_t lc, const char* filename, linker_file_t* resu
out:
if (error && lf)
linker_file_unload(lf);
- VOP_UNLOCK(nd.ni_vp, 0, p);
- vn_close(nd.ni_vp, FREAD, p->p_ucred, p);
+ VOP_UNLOCK(nd.ni_vp, 0, td);
+ vn_close(nd.ni_vp, FREAD, p->p_ucred, td);
return error;
}
OpenPOWER on IntegriCloud