What happens to an open file handle on Linux if the pointed file gets moved or deleted

If the file is moved (in the same filesystem) or renamed, then the file handle remains open and can still be used to read and write the file. If the file is deleted, the file handle remains open and can still be used (This is not what some people expect). The file will not really … Read more

Why use bzero over memset?

I don’t see any reason to prefer bzero over memset. memset is a standard C function while bzero has never been a C standard function. The rationale is probably because you can achieve exactly the same functionality using memset function. Now regarding efficiency, compilers like gcc use builtin implementations for memset which switch to a … Read more

Programmatically get the cache line size?

On Linux (with a reasonably recent kernel), you can get this information out of /sys: /sys/devices/system/cpu/cpu0/cache/ This directory has a subdirectory for each level of cache. Each of those directories contains the following files: coherency_line_size level number_of_sets physical_line_partition shared_cpu_list shared_cpu_map size type ways_of_associativity This gives you more information about the cache then you’d ever hope … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)