so calling an ioctl seems to clear the global argc in klibc built with gcc-9
163 if(ioctl (fd, LOOP_GET_STATUS, &loopinfo) == 0)
(gdb) bt
#0 find_unused_loop_device () at usr/utils/losetup.c:163
#1 0x0000000000401135 in main (argc=2, argv=0x7fffffffe618) at usr/utils/losetup.c:454
(gdb) n
164 someloop++; /* in use */
(gdb) bt
#0 find_unused_loop_device () at usr/utils/losetup.c:164
#1 0x0000000000401135 in main (argc=0, argv=0x7fffffffe618) at usr/utils/losetup.c:454
so calling an ioctl seems to clear the global argc in klibc built with gcc-9
163 if(ioctl (fd, LOOP_GET_STATUS, &loopinfo) == 0) loop_device () at usr/utils/ losetup. c:163 e618) at usr/utils/ losetup. c:454 loop_device () at usr/utils/ losetup. c:164 e618) at usr/utils/ losetup. c:454
(gdb) bt
#0 find_unused_
#1 0x0000000000401135 in main (argc=2, argv=0x7fffffff
(gdb) n
164 someloop++; /* in use */
(gdb) bt
#0 find_unused_
#1 0x0000000000401135 in main (argc=0, argv=0x7fffffff