Skip to contentSkip to conversation

lib: Add headers to generic library files

PATCH Applied Thomas Huth 3 participants 5 messages Apr 7, 2017 – Apr 26, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: Add headers to generic library files

Many files in the lib folder do not have proper statements about their license. Add such a header there so that it is clear under which conditions the code can be used.

---
 lib/argv.c    | 7 +++++++
 lib/auxinfo.h | 4 ++++
 lib/errata.h  | 6 ++++++
 lib/printf.c  | 7 +++++++
 lib/setjmp.h  | 6 ++++++
 lib/stack.c   | 7 +++++++
 lib/stack.h   | 6 ++++++
 lib/string.c  | 7 +++++++
 lib/string.h  | 6 ++++++
 9 files changed, 56 insertions(+)
lib/argv.c +7 -0
index a37fc87..f2466d4 100644
@@ -1,3 +1,10 @@
+/*
+ * Set up arguments for main() and prepare environment variables
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 #include "auxinfo.h"
 
lib/auxinfo.h +4 -0
index ef2376b..669ba5d 100644
@@ -1,3 +1,7 @@
+/*
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _AUXINFO_H_
 #define _AUXINFO_H_
 struct auxinfo {
lib/errata.h +6 -0
index 5e63f73..7b089c2 100644
@@ -1,3 +1,9 @@
+/*
+ * errata functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _ERRATA_H_
 #define _ERRATA_H_
 
lib/printf.c +7 -0
index 2aec59a..063a1ed 100644
@@ -1,3 +1,10 @@
+/*
+ * libc printf and friends
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 #define BUFSZ 2000
lib/setjmp.h +6 -0
index 334f466..2c56b4c 100644
@@ -1,3 +1,9 @@
+/*
+ * setjmp/longjmp prototypes
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef LIBCFLAT_SETJMP_H
 #define LIBCFLAT_SETJMP_H 1
 
lib/stack.c +7 -0
index b0a0295..bdb23fd 100644
@@ -1,3 +1,10 @@
+/*
+ * stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include <libcflat.h>
 #include <stack.h>
 
lib/stack.h +6 -0
index cfc66f4..10fc2f7 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _STACK_H_
 #define _STACK_H_
 
lib/string.c +7 -0
index 833f22b..776fa0d 100644
@@ -1,3 +1,10 @@
+/*
+ * libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 unsigned long strlen(const char *buf)
lib/string.h +6 -0
index 2391013..493d51b 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef __STRING_H
 #define __STRING_H
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 148 lines · Thomas Huth

Many files in the lib folder do not have proper statements about their license. Add such a header there so that it is clear under which conditions the code can be used.

---
 lib/argv.c    | 7 +++++++
 lib/auxinfo.h | 4 ++++
 lib/errata.h  | 6 ++++++
 lib/printf.c  | 7 +++++++
 lib/setjmp.h  | 6 ++++++
 lib/stack.c   | 7 +++++++
 lib/stack.h   | 6 ++++++
 lib/string.c  | 7 +++++++
 lib/string.h  | 6 ++++++
 9 files changed, 56 insertions(+)
lib/argv.c +7 -0
index a37fc87..f2466d4 100644
@@ -1,3 +1,10 @@
+/*
+ * Set up arguments for main() and prepare environment variables
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 #include "auxinfo.h"
 
lib/auxinfo.h +4 -0
index ef2376b..669ba5d 100644
@@ -1,3 +1,7 @@
+/*
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _AUXINFO_H_
 #define _AUXINFO_H_
 struct auxinfo {
lib/errata.h +6 -0
index 5e63f73..7b089c2 100644
@@ -1,3 +1,9 @@
+/*
+ * errata functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _ERRATA_H_
 #define _ERRATA_H_
 
lib/printf.c +7 -0
index 2aec59a..063a1ed 100644
@@ -1,3 +1,10 @@
+/*
+ * libc printf and friends
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 #define BUFSZ 2000
lib/setjmp.h +6 -0
index 334f466..2c56b4c 100644
@@ -1,3 +1,9 @@
+/*
+ * setjmp/longjmp prototypes
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef LIBCFLAT_SETJMP_H
 #define LIBCFLAT_SETJMP_H 1
 
lib/stack.c +7 -0
index b0a0295..bdb23fd 100644
@@ -1,3 +1,10 @@
+/*
+ * stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include <libcflat.h>
 #include <stack.h>
 
lib/stack.h +6 -0
index cfc66f4..10fc2f7 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _STACK_H_
 #define _STACK_H_
 
lib/string.c +7 -0
index 833f22b..776fa0d 100644
@@ -1,3 +1,10 @@
+/*
+ * libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 unsigned long strlen(const char *buf)
lib/string.h +6 -0
index 2391013..493d51b 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef __STRING_H
 #define __STRING_H
 
Signature · 1 line
1.8.3.1

Thanks,
drew

#2 lore raw
Quoted 146 lines · Andrew Jones
Quoted 145 lines · Thomas Huth

Many files in the lib folder do not have proper statements about their license. Add such a header there so that it is clear under which conditions the code can be used.

---
 lib/argv.c    | 7 +++++++
 lib/auxinfo.h | 4 ++++
 lib/errata.h  | 6 ++++++
 lib/printf.c  | 7 +++++++
 lib/setjmp.h  | 6 ++++++
 lib/stack.c   | 7 +++++++
 lib/stack.h   | 6 ++++++
 lib/string.c  | 7 +++++++
 lib/string.h  | 6 ++++++
 9 files changed, 56 insertions(+)
lib/argv.c +7 -0
index a37fc87..f2466d4 100644
@@ -1,3 +1,10 @@
+/*
+ * Set up arguments for main() and prepare environment variables
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 #include "auxinfo.h"
 
lib/auxinfo.h +4 -0
index ef2376b..669ba5d 100644
@@ -1,3 +1,7 @@
+/*
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _AUXINFO_H_
 #define _AUXINFO_H_
 struct auxinfo {
lib/errata.h +6 -0
index 5e63f73..7b089c2 100644
@@ -1,3 +1,9 @@
+/*
+ * errata functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _ERRATA_H_
 #define _ERRATA_H_
 
lib/printf.c +7 -0
index 2aec59a..063a1ed 100644
@@ -1,3 +1,10 @@
+/*
+ * libc printf and friends
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 #define BUFSZ 2000
lib/setjmp.h +6 -0
index 334f466..2c56b4c 100644
@@ -1,3 +1,9 @@
+/*
+ * setjmp/longjmp prototypes
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef LIBCFLAT_SETJMP_H
 #define LIBCFLAT_SETJMP_H 1
 
lib/stack.c +7 -0
index b0a0295..bdb23fd 100644
@@ -1,3 +1,10 @@
+/*
+ * stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include <libcflat.h>
 #include <stack.h>
 
lib/stack.h +6 -0
index cfc66f4..10fc2f7 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for stack related functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef _STACK_H_
 #define _STACK_H_
 
lib/string.c +7 -0
index 833f22b..776fa0d 100644
@@ -1,3 +1,10 @@
+/*
+ * libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 
 unsigned long strlen(const char *buf)
lib/string.h +6 -0
index 2391013..493d51b 100644
@@ -1,3 +1,9 @@
+/*
+ * Header for libc string functions
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
 #ifndef __STRING_H
 #define __STRING_H
 
Quoted 5 lines
Quoted 3 lines
Signature · 1 line
1.8.3.1

*ping*

Paolo, Radim, could you pick this up please if it sounds OK for you?

Thanks,
Thomas

#3 lore raw

2017-04-25 09:11+0200, Thomas Huth:

Quoted 23 lines · Andrew Jones
Quoted 5 lines · Thomas Huth
Quoted 4 lines

Many files in the lib folder do not have proper statements about their license. Add such a header there so that it is clear under which conditions the code can be used.

Quoted 16 lines
Quoted 4 lines

---

lib/argv.c line 10

Quoted 10 lines
lib/argv.c +7 -0
@@ -1,3 +1,10 @@
+/*
+ * Set up arguments for main() and prepare environment variables
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 #include "auxinfo.h"
 
Quoted 1 line

*ping*

(Sorry, I'll need to double-check all unit test patches from that time.)

Quoted 1 line

Paolo, Radim, could you pick this up please if it sounds OK for you?

It does, the licensing follows COPYRIGHT and I assume that we can't change the license without a lot of legal hassle.

Took me a while to realize what isn't clear: libcflat.h is GPL 2 and being explicit with the border between GPL 2 and LGPL 2 sounds good for re-usability of the code. (I assume that the whole kvm-unit-tests is effectively GPL 2, but parts of it are more benevolent.)

Applied, thanks.

#4 lore raw
Quoted 30 lines · Radim Krčmář

2017-04-25 09:11+0200, Thomas Huth:

Quoted 23 lines · Andrew Jones
Quoted 5 lines · Thomas Huth
Quoted 4 lines

Many files in the lib folder do not have proper statements about their license. Add such a header there so that it is clear under which conditions the code can be used.

Quoted 16 lines
Quoted 4 lines

---

lib/argv.c line 10

Quoted 10 lines
lib/argv.c +7 -0
@@ -1,3 +1,10 @@
+/*
+ * Set up arguments for main() and prepare environment variables
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License version 2.
+ */
+
 #include "libcflat.h"
 #include "auxinfo.h"
 
Quoted 1 line

*ping*

(Sorry, I'll need to double-check all unit test patches from that time.)

Quoted 1 line

Paolo, Radim, could you pick this up please if it sounds OK for you?

Quoted 7 lines

It does, the licensing follows COPYRIGHT and I assume that we can't change the license without a lot of legal hassle.

Took me a while to realize what isn't clear: libcflat.h is GPL 2 and being explicit with the border between GPL 2 and LGPL 2 sounds good for re-usability of the code. (I assume that the whole kvm-unit-tests is effectively GPL 2, but parts of it are more benevolent.)

I think we should update the COPYRIGHT file with this information - saying that the whole kvm-unit-tests is under GPL 2 nowadays, but single files might be LGPL 2 (or other compatible licenses) instead...

Thomas