/* gpu_v1_ptr.c - v1 of a library whose struct contains a POINTER.
 * Build: gcc -shared -fPIC -Wl,-soname,libgpuptr.so.1 -o libgpuptr.so.1.0.0 gpu_v1_ptr.c
 * Then:  ln -sf libgpuptr.so.1.0.0 libgpuptr.so.1
 *        ln -sf libgpuptr.so.1     libgpuptr.so
 *
 * Layout (x86-64):
 *   offset 0 : int   gpu_id
 *   offset 4 : int   temperature
 *   offset 8 : char* name
 *   total size: 16
 */

struct gpu_info {
    int gpu_id;
    int temperature;
    const char *name;
};

void gpu_info_get(struct gpu_info *info) {
    info->gpu_id = 42;
    info->temperature = 99;
    info->name = "Tesla T4";
}
