提交 9e25ae6d 编写于 作者: M Michael Ellerman 提交者: Paul Mackerras

[POWERPC] spufs: Respect RLIMIT_CORE in spu coredump code

Currently the spu coredump code doesn't respect the ulimit, it should.
Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 7af1443a
......@@ -53,8 +53,12 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
*/
static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
{
unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
ssize_t written;
if (*foffset + nr > limit)
return -EIO;
written = file->f_op->write(file, addr, nr, &file->f_pos);
*foffset += written;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册