Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
*/
char * os_readfile(const char *name, size_t *len);
+/**
+ * os_file_exists - Check whether the specified file exists
+ * @fname: Path and name of the file
+ * Returns: 1 if the file exists or 0 if not
+ */
+int os_file_exists(const char *fname);
+
/**
* os_zalloc - Allocate and zero memory
* @size: Number of bytes to allocate
}
+int os_file_exists(const char *fname)
+{
+ FILE *f = fopen(fname, "rb");
+ if (f == NULL)
+ return 0;
+ fclose(f);
+ return 1;
+}
+
+
#ifndef WPA_TRACE
void * os_zalloc(size_t size)
{