Add hint on being root for EPERM and shmhuge error
authorJens Axboe <jens.axboe@oracle.com>
Mon, 14 Sep 2009 06:51:55 +0000 (08:51 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 14 Sep 2009 06:51:55 +0000 (08:51 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
memory.c

index 5285c0a5d416cf2eb40dd5f0698d90927ddf05fb..7f4cef529a52e55ecbf099c0e23738943ab2b492 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -76,7 +76,7 @@ static int alloc_mem_shm(struct thread_data *td, unsigned int total_mem)
        dprint(FD_MEM, "shmget %u, %d\n", total_mem, td->shm_id);
        if (td->shm_id < 0) {
                td_verror(td, errno, "shmget");
-               if (geteuid() != 0 && errno == ENOMEM)
+               if (geteuid() != 0 && (errno == ENOMEM || errno == EPERM))
                        log_err("fio: you may need to run this job as root\n");
                if (td->o.mem_type == MEM_SHMHUGE) {
                        if (errno == EINVAL) {