If the modid value is 0, then modnext will return the modid of the first module. The modfnext system call must always be given a valid modid.