]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/udev/mtd_probe/mtd_probe.c
2 * Copyright (C) 2010 - Maxim Levitsky
4 * mtd_probe is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * mtd_probe is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with mtd_probe; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301 USA
21 #include <mtd/mtd-user.h>
24 #include <sys/ioctl.h>
26 #include <sys/types.h>
29 #include "mtd_probe.h"
31 int main(int argc
, char** argv
)
38 printf("usage: mtd_probe /dev/mtd[n]\n");
42 mtd_fd
= open(argv
[1], O_RDONLY
|O_CLOEXEC
);
48 error
= ioctl(mtd_fd
, MEMGETINFO
, &mtd_info
);
54 probe_smart_media(mtd_fd
, &mtd_info
);