Helpful indication to run as root
authorJens Axboe <jens.axboe@oracle.com>
Mon, 19 Mar 2007 10:36:36 +0000 (11:36 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 19 Mar 2007 10:36:36 +0000 (11:36 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
memory.c

index 384b80617f609ca65c6f099b1c073de4c78cc20c..be664c9c22a40285cd07c6f7f69da120408618d7 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -70,6 +70,9 @@ int allocate_io_mem(struct thread_data *td)
                td->shm_id = shmget(IPC_PRIVATE, td->orig_buffer_size, flags);
                if (td->shm_id < 0) {
                        td_verror(td, errno, "shmget");
                td->shm_id = shmget(IPC_PRIVATE, td->orig_buffer_size, flags);
                if (td->shm_id < 0) {
                        td_verror(td, errno, "shmget");
+                       if (geteuid() != 0 && errno == ENOMEM)
+                               log_err("fio: you may need to run this job as root\n");
+                       
                        return 1;
                }
 
                        return 1;
                }