<p>A library using off_t as a parameter for one function (seek). Library and application are compiled differently, one with large file support switched off, the other with large file support. This situation results in strange runtime errors, because both interpret off_t differently. How can the library check at runtime the size of off_t for the app? Or is there another solution, so that at least the user gets a meaningful error?</p>

<p>EDIT: The library (programmed in c and with autoconf) already exists and some third-party application use it. The library can be compiled with large file support (by default via AC_SYS_LARGEFILE). It is multiplatform, not only linux. How can be detected/prevented that installed applications will be broken by the change in LFS?</p>

You could add an API to the library to return the sizeof(off_t) and then check it from the client.  Alternatively the library could require every app to provide the API in order to successfully link:
library.c:
```
```
size_t lib_get_off_t_size (void)
{
    return (sizeof(off_t));
}
```
```
client.c (init_function):
```
```
if (lib_get_off_t_size() != sizeof(off_t) {
    printf("Oh no!\n");
    exit();
}
```
```
If the library has an init function then you could put the check there, but then the client would have to supply the API to get the size of its off_t, which generally isn't how libraries work.