Пример #1
0
/*
 * Load the image for an (coff) binary.
 *
 *   => this procedure is called by the main load sequence,
 *      it will load the executable and prepare it for execution
 */
static int
coff_load_binary(struct linux_binprm *bpp, struct pt_regs *rp)
{
	int ret;

	ret = coff_load_object(bpp, rp, 1);
	if (ret >= 0) SYS(vserver,rp);

	return ret;
}
Пример #2
0
/*
 * Load the image for a (coff) shared library.
 *
 *   => this is called when we need to load a library based upon a file name.
 *   => also called through coff_preload_shlib
 */
static int
coff_load_shlib(struct file *fp)
{
	struct linux_binprm		*bpp;
	struct pt_regs			regs;
	int				err = -ENOMEM;

	if (!(bpp = kmalloc(sizeof(struct linux_binprm), GFP_KERNEL))) {
		printk(KERN_WARNING "coff: kmalloc failed\n");
		goto out;
	}

	memset(bpp, 0, sizeof(struct linux_binprm));
	bpp->file = fp;

	if ((err = kernel_read(fp, 0L, bpp->buf, sizeof(bpp->buf))) < 0)
		printk(KERN_WARNING "coff: unable to read library header\n");
	else
		err = coff_load_object(bpp, &regs, 0);

	kfree(bpp);
out:
	return (err);
}
Пример #3
0
/*
 * Load the image for an (coff) binary.
 *
 *   => this procedure is called by the main load sequence,
 *      it will load the executable and prepare it for execution
 */
static int
coff_load_binary(struct linux_binprm *bpp, struct pt_regs *rp)
{
	return (coff_load_object(bpp, rp, 1));
}