Re: [PATCH -mm 1/3] swsusp: Add ioctl for swap files support



On Saturday, 30 September 2006 16:15, Arnd Bergmann wrote:
Am Friday 29 September 2006 01:35 schrieb Rafael J. Wysocki:
@@ -119,7 +119,18 @@ extern int snapshot_image_loaded(struct
 #define SNAPSHOT_SET_SWAP_FILE         _IOW(SNAPSHOT_IOC_MAGIC, 10,
unsigned int) #define
SNAPSHOT_S2RAM                 _IO(SNAPSHOT_IOC_MAGIC, 11) #define
SNAPSHOT_PMOPS                 _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int)
-#define SNAPSHOT_IOC_MAXNR     12
+#define SNAPSHOT_SET_SWAP_AREA         _IOW(SNAPSHOT_IOC_MAGIC, 13, void *)
+#define SNAPSHOT_IOC_MAXNR     13

Your definition looks wrong, '_IOW(SNAPSHOT_IOC_MAGIC, 13, void *)' means
your ioctl passes a pointer to a 'void *'.

You probably mean

#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \
struct resume_swap_area)

No. I mean the ioctl passes a pointer, the size of which is sizeof(void *).

Greetings,
Rafael


--
You never change things by fighting the existing reality.
R. Buckminster Fuller
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: how to use the function copyout()
    ... > flag, struct thread *td) ... The generic ioctl layer will handle all of the copying ... > contains the size of the data to be copied in and a pointer to the data, ...
    (freebsd-hackers)
  • Re: [PATCH -mm 1/3] swsusp: Add ioctl for swap files support
    ... your ioctl passes a pointer to a 'void *'. ... struct resume_swap_area) ...
    (Linux-Kernel)
  • Re: how to use the function copyout()
    ... flag, struct thread *td) ... The generic ioctl layer will handle all of the copying ... contains the size of the data to be copied in and a pointer to the data, ...
    (freebsd-hackers)
  • Re: Suggestion: LKM should be able to add system call for itself
    ... write every system call using something like ioctl. ... syscall number and a pointer to data.) ... does not say why syscalls are better than ioctl or netlink. ... a specific preferred method (syscalls, cdev, libnl, ioctl) to do it ...
    (Linux-Kernel)
  • Re: copy_from_user/copy_to_user question
    ... > the handling of ioctl calls in the driver for a chip ... long) within the struct, it can use get_user, and not the bigger cousin ... The arg value passed in for the ioctl is OK to read ... if this arg is dereferenced as a pointer, then you must use one of the ...
    (Linux-Kernel)