Hi, i'm writing a C code which would schedule some backup in linux. It takes in a device as one of its arguments.

I want to check whether the device is valid for storing the backup(or if that device even exists or not) before i proceed to do anything.

I'm just wondering if there is like a function that i can call to do this? or a function that would give me a list of device where i can compare it, or something similar....